初学者关于查询例子的一个简单问题
表格:
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的条件?
谢谢!
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的条件?
谢谢!
...全文
相关推荐
VB初学例子.zip_初学者_初学者小例子打包
包含许多VB初学者可参考的小例子,简单明了,初学者必要。
C#简单封装的一个例子,初学者适用
用了几个类,将分装好几个操作数据库类供后台代码调用,减少代码的冗余,加强了效率。
易语言MDB多表查询的简单例子
易语言MDB多表查询的简单例子源码,MDB多表查询的简单例子,初始化,记录填充组合框,取唯一文本记录值,记录填充超级列表框
DEVc++编译工具和简单例子程序
DEVc++编译工具和简单例子程序。DEVc++编译工具和简单例子程序。 适合初学者,学习c++,附带16个简单例子程序。
经典c#例子压缩——初学者必备
里面有很多经典例子,初学者必备,简单易懂



