Get the latest date from grouped MySQL data

前端 未结 7 883
一生所求
一生所求 2020-11-27 04:29

I have the following data in my database:

|NO | model | date     | 
+---+-------+----------+
|1  | bee   |2011-12-01|
|2  | bee   |2011-12-05|
|3  | bee   |2         


        
7条回答
  •  感情败类
    2020-11-27 05:07

    try this:

    SELECT model, date
    FROM doc
    WHERE date = (SELECT MAX(date)
    FROM doc GROUP BY model LIMIT 0, 1)
    GROUP BY model
    

提交回复
热议问题