MySQL嵌套选择X和Y
所以我试图进入MySQL,我正在做SQLZoo教程 有一个练习介绍了一些新技术(来自world x和world y)——x和y在这里做什么 有人能帮我把代码一行一行地分解一下吗? 谢谢你的帮助。提前谢谢MySQL嵌套选择X和Y,mysql,select,Mysql,Select,所以我试图进入MySQL,我正在做SQLZoo教程 有一个练习介绍了一些新技术(来自world x和world y)——x和y在这里做什么 有人能帮我把代码一行一行地分解一下吗? 谢谢你的帮助。提前谢谢 SELECT continent, name, population FROM world x WHERE population >= ALL (SELECT population FROM world y WHERE y.continent=x.contine
SELECT continent, name, population FROM world x
WHERE population >= ALL
(SELECT population FROM world y
WHERE y.continent=x.continent
AND population>0)
这是别名。在本例中,x.Continental与world.Continental相同。
但在子查询中,y.contintent与wordl.continent是相同的。使用别名,您可以加入同一个表这是别名。在本例中,x.Continental与world.Continental相同。
但在子查询中,y.contintent与wordl.continent是相同的。使用别名,您可以加入同一个表这是别名。在本例中,x.Continental与world.Continental相同。
但在子查询中,y.contintent与wordl.continent是相同的。使用别名,您可以加入同一个表这是别名。在本例中,x.Continental与world.Continental相同。
但在子查询中,y.contintent与wordl.continent是相同的。使用别名,您可以加入同一个表
x
和y
是您的结果集的有效名称,因此可以引用它们,而不会产生任何歧义
类似地,如果您对两个列名称相同的表(例如
customer
表和order
表,这两个表都有id\u customer
字段)执行JOIN
,您将引用表名,然后是列名(例如,order.id\u customer
,明确说明您不是指customer.id\u customer
)x
和y
是结果集的有效名称,因此可以毫无歧义地引用它们
类似地,如果您对两个列名称相同的表(例如
customer
表和order
表,这两个表都有id\u customer
字段)执行JOIN
,您将引用表名,然后是列名(例如,order.id\u customer
,明确说明您不是指customer.id\u customer
)x
和y
是结果集的有效名称,因此可以毫无歧义地引用它们
类似地,如果您对两个列名称相同的表(例如
customer
表和order
表,这两个表都有id\u customer
字段)执行JOIN
,您将引用表名,然后是列名(例如,order.id\u customer
,明确说明您不是指customer.id\u customer
)x
和y
是结果集的有效名称,因此可以毫无歧义地引用它们
类似地,如果您对两个列名称相同的表(例如customer
表和order
表,这两个表都有id\u customer
字段)执行JOIN
,您将引用表名,然后是列名(例如,order.id\u customer
,明确表示您不是指customer.id\u customer
)