MySql获取某一天每个小时的数据

MySql获取某一天每个小时的数据,第1张

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 * from table where FROM_UNIXTIME(time, '%Y-%m-%d')=date_format('2019-08-16', '%Y-%m-%d')

select * from table where date between unix_timestamp('2013-8-19 00:00:00') and unix_timestamp('2013-8-20 00:00:00)


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/6160419.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-16
下一篇 2023-03-16

发表评论

登录后才能评论

评论列表(0条)

保存