MySql获取某一天每个小时的数据
2021-09-07 本文已影响0人
猫的树
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);