MySQL - SELECT the name that comes first alphabetically

后端 未结 11 1391
悲&欢浪女
悲&欢浪女 2020-12-24 08:50

I have started to learn MySQL.

Here is the table world:

+-------------+-----------+---------+
|    name     | continent |  area   |
+--         


        
11条回答
  •  生来不讨喜
    2020-12-24 09:12

    what about this sql :

    select distinct continent, 
          (select name 
           from world y where y.continent = x.continent limit 1 ) as name 
    from world x
    

提交回复
热议问题