Using ORDER BY and GROUP BY together

前端 未结 7 1871
清酒与你
清酒与你 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 06:00

    You can try this

     SELECT tbl.* FROM (SELECT * FROM table ORDER BY timestamp DESC) as tbl
     GROUP BY tbl.m_id  
    
    0 讨论(0)
提交回复
热议问题