MySQL 按日期 group by 實現

背景: 最近在統計數據,今天有個要求是要統計天天的訂單數量。表中 created_date (建立日期)字段是 datetime 類型。html   心路歷程: 1. group by 字符串sql 把 created_date 變成 字符串,而後截取前十位, 使用 group by, 統計 count(0)函數 嘗試瞭如下 sql 以後,沒有成功。code SELECT substring(c
相關文章
相關標籤/搜索