报错-Every derived table must have its own alias

Study by yourself and refer to it. If there are any mistakes, please correct me!

mysql problem: error-Every derived table must have its own alias

This error generally occurs in SQL multi-table queries or nested queries. This means that each derived table (temporary table) must have its own alias.

All the solutions are that in nested queries, the derived table that appears must be aliased, such as 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 ?

Guess you like

Origin blog.csdn.net/weixin_42164880/article/details/106592042