mysql 查詢 范圍,怎樣查詢一個時間范圍內?
SELECT
DATE_FORMAT( datetime列, '%Y-%m-%d' ) AS 日期,
SUM( ... ) AS 合計,
COUNT( ... ) AS 行數
FROM
表
GROUP BY
DATE_FORMAT( datetime列, '%Y-%m-%d' )
SELECT
DATE_FORMAT( datetime列, '%Y-%m-%d' ) AS 日期,
SUM( ... ) AS 合計,
COUNT( ... ) AS 行數
FROM
表
GROUP BY
DATE_FORMAT( datetime列, '%Y-%m-%d' )