mysql statistics

  1. Press one time packet statistics
    1. DATE_FORMAT(t.`create_time`, '%Y-%m-%d %H')按小时
    2. MID(l.Create_Time,1,10)第一个数字从一开始代表起始截取数,第二个数字代表结束数
  2. 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
  3. 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');
    

      

    1. where the determination condition may be later processed data select
      1. https://www.jb51.net/article/141238.htm

Guess you like

Origin www.cnblogs.com/wzdnwyyu/p/11119464.html