MySql获取某一天每个小时的数据
select hour(create_time) AS saleHour, count(id) AS saleCount
from tableName where date_format(create_time, ‘%Y-%m-%d’ ) = ‘2021-09-07’
group by hour(create_time);
select hour(create_time) AS saleHour, count(id) AS saleCount
from tableName where date_format(create_time, ‘%Y-%m-%d’ ) = ‘2021-09-07’
group by hour(create_time);