Home > database > How MySQL query table each time point table data in total
How MySQL query table each time point table data in total
Time:10-29
Needs to query each time point corresponding to the total data in the table, such as the 2020-01-01 12:00:00 schedule according to the total amount is 100000, 2020-01-01 14:00:00 schedule according to the total amount of 150000 How to query and returns the time point and the corresponding according to total quantity?
CodePudding user response:
The select date_format (date, '% Y - m - H % d % %') as d, count (*) as CNT From the table Group by d