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
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,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?
一般在多表查询时,会出现此错误。
因为,进行嵌套查询的时候子查询出来的的结果是作为一个派生表来进行上一级的查询的,所以子查询的结果必须要有一个别名
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 ;
在第一个子查询后面设置一个别名就可以了