初学者关于查询例子的一个简单问题
表格:
name continent population
China Asia 1300000000
... ... ...
问题:
Find the largest country in each continent, show the continent, the name and the population:
答案:
SELECT continent, name, population FROM world x
WHERE population >= ALL
(SELECT population FROM world y
WHERE y.continent=x.continent
AND population>0)
疑问:在这里设x和y表是什么意思?为什么最后还要加上population>0的条件?
谢谢!