Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有可能有一个查询从包含完整 date_time 值的 date_time 字段的表中选择按天或月分组的行?
我需要得到每天的 sr13, r4, huawei 的总和。任何关于我如何做到这一点的想法都将不胜感激!
您可以使用DATE()从值中提取日期,
DATE()
SELECT DATE(date_time) datetime, SUM(sr13) total_sr13, SUM(r4) total_4 FROM TableName GROUP BY DATE(date_time)