mysql查詢學(xué)生數(shù)據(jù),怎樣查詢一個(gè)時(shí)間范圍內(nèi)?
SELECT
DATE_FORMAT( datetime列, '%Y-%m-%d' ) AS 日期,
SUM( ... ) AS 合計(jì),
COUNT( ... ) AS 行數(shù)
FROM
表
GROUP BY
DATE_FORMAT( datetime列, '%Y-%m-%d' )
SELECT
DATE_FORMAT( datetime列, '%Y-%m-%d' ) AS 日期,
SUM( ... ) AS 合計(jì),
COUNT( ... ) AS 行數(shù)
FROM
表
GROUP BY
DATE_FORMAT( datetime列, '%Y-%m-%d' )