select hour(dateTime) as hour, count(1) as count
from tableName where DATE_FORMAT(dateTime,'%Y-%m-%d') = '2001-01-01' group by hour(dateTime);
SELECT COUNT(1) FROM wx_pvuv_log where DATE_FORMAT(create_time,'%Y-%m-%d %H') = '2015-07-20 21';
本文共 292 字,大约阅读时间需要 1 分钟。
select hour(dateTime) as hour, count(1) as count
from tableName where DATE_FORMAT(dateTime,'%Y-%m-%d') = '2001-01-01' group by hour(dateTime);
SELECT COUNT(1) FROM wx_pvuv_log where DATE_FORMAT(create_time,'%Y-%m-%d %H') = '2015-07-20 21';
转载于:https://www.cnblogs.com/dashuai01/p/4981634.html