【mysql解决方案】ERROR 1248 (42000): Every derived table must have its own alias
程序员文章站
2022-05-31 22:11:35
...
简述
学习mysql的时候遇到了这个问题。
查了一下 https://*.com/questions/3363918/mysql-error-1248-42000-every-derived-table-must-have-its-own-alias 这是*的大佬给的解答。
其实是很简单的一个问题。
就是在多级查询的过程中,会需要给表一个别名。
代码
错误的查询方式:
select * from (select s.sno from student s where s.ssex='女');
正确的查询方式:
select * from (select s.sno from student s where s.ssex='女') as mid_sno;
其实区别,就在于背后有没有那个as mid_sno
。
这是为了保证每个派生出来的表都需要有一个自己的别名。
上一篇: QT中使用Lua
推荐阅读
-
MySQL 脚本报错:Every derived table must have its own alias 每个派生表必须有自己的别名
-
Mysql错误Every derived table must have its own alias解决方法
-
mysql-MySQL错误Every derived table must have its own alias
-
mysql-MySQL错误Every derived table must have its own alias
-
MySQL碰到“Every derived table must have its own alias”类似错误说明
-
【mysql解决方案】ERROR 1248 (42000): Every derived table must have its own alias
-
MySQL 脚本报错:Every derived table must have its own alias 每个派生表必须有自己的别名
-
Mysql错误Every derived table must have its own alias解决方法