时间:2021-07-01 10:21:17 帮助过:3人阅读
<!-- 按日查询--> SELECT DATE_FORMAT(created_at,‘%Y-%m-%d‘) as day, SUM(COUNT) FROM collect GROUP BY day; <!-- 按周查询--> SELECT DATE_FORMAT(created_at,‘%Y-%u‘) as day, SUM(COUNT) FROM collect GROUP BY day; <!-- 按月查询--> SELECT DATE_FORMAT(created_at,‘%Y-%m‘) as day, SUM(COUNT) FROM collect GROUP BY day; <!-- 按年查询--> SELECT DATE_FORMAT(created_at,‘%Y‘) as day, SUM(COUNT) FROM collect GROUP BY day;
Mysql 查询
标签:技术 mys group 分享图片 style collect rom src _for