列出总人口至少为 1 亿的大陆。
World Table
name continent area population gdp
Afghanistan Asia 652230 25500100 20343000000
Albania Europe 28748 2831741 12960000000
Algeria Africa 2381741 37100000 188681000000
Andorra Europe 468 78115 3712000000
Angola Africa 1246700 20609294 10009000990
...
...
我开始了
SELECT continent FROM world WHERE ...
和有点卡在这里。不确定如何利用 GROUP BY 和 SUM。我需要
GROUP BY continent
和SUM(population)
一些方法,但我仍在学习如何将东西放在一起。预期产出
continent
Africa
Asia
Eurasia
Europe
North America
South America
最佳答案
SELECT continent, SUM(population)
FROM world
GROUP BY continent
HAVING SUM(population) >= 100000000
关于SQL GROUP BY 和 SUM,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25174862/