如何在 24 小时内的每个小时之间创建一个计数行?
我有一张这样的 table
[ID] [Time(epoch time)]
谢谢
最佳答案
我希望我已经理解你的问题了
select from_unixtime(visittime,'%H') as h,count(*) as total
from table
where from_unixtime(visittime) >= now() - interval 1 day
group by h
关于php - 我如何用 epoch 和 mysql 每小时计数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5717205/