2 lafeedfh lafeedfh 于 2015.07.26 21:25 提问

MySQL错误Every derived table must have its own alias

SELECT *
from (select *
from student
where dept_name = 'Comp.Sci.')
natural full outer join
(select *
from takes
where semester = 'Spring' and year = 2009 ) as aa ;

        到底怎么改 T-T

3个回答

caozhy
caozhy   Ds   Rxr 2015.07.26 22:40

一般在多表查询时,会出现此错误。
因为,进行嵌套查询的时候子查询出来的的结果是作为一个派生表来进行上一级的查询的,所以子查询的结果必须要有一个别名

jackson0215
jackson0215   2015.07.26 23:18

SELECT *
from (select *
from student
where dept_name = 'Comp.Sci.') as bb
natural full outer join
(select *
from takes
where semester = 'Spring' and year = 2009 ) as aa ;

在第一个子查询后面设置一个别名就可以了

CSDNXIAOS
CSDNXIAOS   2015.07.26 21:35

Select distinct(LAC_CI) from (Select LAC_CI from dtdb_sh_test.dt_measurment where callid='04021002ms31310379260576' union Select LAC_CI from dtdb_sh_test.dt_measurment where callid='04021002ms3131......
答案就在这里:MySQL错误:Every derived table must have its own alias
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?

Csdn user default icon
上传中...
上传图片
插入图片