- Press one time packet statistics
DATE_FORMAT(t.`create_time`,
'%Y-%m-%d %H'
)按小时
MID(l.Create_Time,1,10)第一个数字从一开始代表起始截取数,第二个数字代表结束数
- Comparative certain period of time, a certain number of hours of orders, check or check out accurate to the hour, the packet is accurate to the hour, it is sorted by H, then ymdh
-
SELECT DATE_FORMAT(t.`create_time`, '%Y-%m-%d %H') t_date, COUNT(1) t_count FROM yyd_order t WHERE DATE_FORMAT(t.`create_time`,'%Y-%m-%d') IN ('2018-05-03','2018-05-11') GROUP BY DATE_FORMAT(t.`create_time`, '%Y-%m-%d %H') ORDER BY DATE_FORMAT(t.`create_time`, '%H'),DATE_FORMAT(t.`create_time`, '%Y-%m-%d %H');
- where the determination condition may be later processed data select
mysql statistics
Guess you like
Origin www.cnblogs.com/wzdnwyyu/p/11119464.html
Recommended
Ranking