Home  >  Q&A  >  body text

sql语句 - 请教关于mysql分组查询统计数据的问题

黄舟黄舟2743 days ago686

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 16:25:43

    I found the answer myself. Reference here
    http://blog.csdn.net/swweb/ar...

    The core statement is modified as follows:

    SELECT `task_id`, MAX(`send_time`) AS `day` FROM `game_work` GROUP BY `task_id` ORDER BY `day` DESC

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 16:25:43

    select sum(num) as num, task_id, day from tablename group by day task_id order by day desc limit 1,30

    reply
    0
  • Cancelreply