1st Row in Group By vs. Last Row

后端 未结 5 769
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-21 10:23

Wondering how to return the 1st row in a MySQL group by vs. the last row. Returning a series of dates, but need the first one displayed.

select * from calendar w         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-21 10:58

    Sounds like you want to use ORDER BY instead of GROUP BY:

    select * from calendar where approved = 'pending' order by eventid asc limit 1;
    

提交回复
热议问题