SELECT DATE_FORMAT( FROM_UNIXTIME( 时间戳字段名), '%Y-%m-%d' ) as date , id,xxx,count(xxx) as total FROM 表名 where DATE_SUB(CURDATE(), INTERVAL 6 DAY) <= FROM_UNIXTIME(时间戳字段名) AND xxx = 2144 GROUP BY date;
参考以下:
https://blog.csdn.net/asenseof/article/details/107918573
https://blog.csdn.net/weixin_60948956/article/details/125110297
http://net.sanhaostreet.com/it/202203/3114841.html
标签:七天,blog,最近,details,https,mysql,DATE,net From: https://www.cnblogs.com/clqbolg/p/16717799.html