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);
本文标题:MySql获取某一天每个小时的数据
本文链接:https://www.haomeiwen.com/subject/vabuwltx.html
网友评论