level 1
列出有至少100百萬(1億)(100,000,000)人口的洲份。
select distinct(continent)
from world x
where 100000000<=(select sum(population) from world y where x.continent=y.continent)
里面x.continent=y.continent的作用是什么?world 后面的x,y 它的实际概念又是什么?
2018年05月30日 06点05分
1
level 9
我咋感觉你的sql语句写错了呢?你运行下,应该过不去。第一个是关键条件,x,y是别名,只是做个标记
2018年05月31日 01点05分
2
level 1
world x 和world y 表示用了两个表名x、y代替重复引用表world
x.continent=y.continent 表示属于同一个洲,
select sum(population) from world y where x.continent=y.continent就是将同一个洲的人数进行总和;
2018年07月21日 02点07分
7