select aa.DAY,(select count(*) from notice t where substr( t.create_time, 1, 10 )=aa.DAY
) as ss
from (SELECT
date_add(DATE_ADD(curdate(), INTERVAL - DAY(curdate()) + 2 DAY),
INTERVAL (cast( help_topic_id AS signed INTEGER ) - 1 ) DAY
) DAY
FROM
mysql.help_topic
WHERE
help_topic_id < DAY ( last_day( curdate( ) ) )
ORDER BY
help_topic_id) aa
mysql中查询当月每一天的数据量没有的补零
最新推荐文章于 2024-04-24 14:48:34 发布