报错-Every derived table must have its own alias

自己学习参考,如有错误,请各位大神指正!

mysql问题:报错-Every derived table must have its own alias

这种错误一般出现在sql的多表查询或嵌套查询中。意思是,每一个派生出来的表(临时表)都必须有自己的别名。

所有解决方法就是嵌套查询中,出现的派生表必须加上别名,例如 as a

select  a.sid, a.sname, a.gender, a.phone, a.birthday, a.hobby, a.info 
#这里的派生表就要加上别名   as a
from (select sid, sname, gender, phone, birthday, hobby, info from stu where 1=1) as a 
limit ? offset ?

猜你喜欢

转载自blog.csdn.net/weixin_42164880/article/details/106592042
今日推荐