Reputation: 7240
Is it ever possible to have a query that selects rows grouped by the day or month from a table that has a date_time filed holding full date_time value?
I need to get the sum of sr13, r4, huawei for each day. Any idea of how I can do it would be heartfully appreciated!
Upvotes: 2
Views: 290
Reputation: 263683
You can use DATE()
to extract the date from the value,
SELECT DATE(date_time) datetime,
SUM(sr13) total_sr13,
SUM(r4) total_4
FROM TableName
GROUP BY DATE(date_time)
Upvotes: 2