Every derived table must have its own alias(sql语句错误解决方法)
作者:互联网
在做多表查询,或者查询的时候产生新的表的时候会出现这个错误:Every derived table must have its own alias(每一个派生出来的表都必须有一个自己的别名)
例如:
select class from (select class,count(distinct student) as num from Courses group by class) where num>=5; 就要给派生出来的表起一个别名修改后的sql,直接在新生产的表中加入别命名就行(“as temp”或者“temp”),“temp”为新表的别名
select class from (select class,count(distinct student) num from Courses group by class) as temp where num>=5;标签:own,temp,derived,别名,alias,num,class,select 来源: https://www.cnblogs.com/kdbb/p/16656677.html