Using ORDER BY and GROUP BY together

前端 未结 7 1946
清酒与你
清酒与你 2020-11-28 05:30

My table looks like this (and I\'m using MySQL):

m_id | v_id | timestamp
------------------------
6    |   1  | 1333635317
34   |   1  | 1333635323
34   |            


        
7条回答
  •  遥遥无期
    2020-11-28 05:49

    Just you need to desc with asc. Write the query like below. It will return the values in ascending order.

    SELECT * FROM table GROUP BY m_id ORDER BY m_id asc;
    

提交回复
热议问题