错误代码: 1248 Every derived table must have its own alias
1、错误描述
1 queries executed, 0 success, 1 errors, 0 warnings 查询:SELECT stu_id, (SELECT stu_name FROM t_student_info t WHERE t.stu_id = t.stu_id) stu_name FROM (SELECT SUM( CASE course WHEN '敮.. 错误代码: 1248 Every derived table must have its own alias 执行耗时 : 0 sec 传送时间 : 0 sec 总耗时 : 0 sec
2、错误原因
SELECT stu_id, (SELECT stu_name FROM t_student_info t WHERE t.stu_id = t.stu_id) stu_name FROM (SELECT SUM( CASE course WHEN '数学' THEN Score ELSE 0 END ) 数学, SUM( CASE course WHEN '语文' THEN score ELSE 0 END ) 语文, SUM( CASE course WHEN '英语' THEN score ELSE 0 END ) 英语, stu_id FROM t_score_info GROUP BY stu_id)
3、解决办法
SELECT * FROM ( SELECT stu_no FROM t_student_info UNION SELECT stu_no FROM t_student_info ) student;
在后面给联合查询取个别名student
错误代码: 1248 Every derived table must have its own alias的更多相关文章
- (转载)1248 - Every derived table must have its own alias
(转载)http://hi.baidu.com/lylegend13/item/a79f17eb51f5dff7e0a5d43b 1. select count(distinct CName) fro ...
- MySql 1248 - Every derived table must have its own alias
执行一个sql语句,报错:1248 - Every derived table must have its own alias 提示说每一个衍生出来的表,必须要有自己的别名 执行子查询的时候,外层查询 ...
- 【mysql报错】[Err] 1248 - Every derived table must have its own alias
当我运行一条联合查询的sql语句时报如下错误: [Err] 1248 - Every derived table must have its own alias,大概意思是每一张派生表必须要有自己的别 ...
- [Err] 1248 - Every derived table must have its own alias
问题描述 [Err] 1248 - Every derived table must have its own alias 问题原因 这句话的意思是说每个派生出来的表都必须有一个自己的别名 我的Mys ...
- MySQL错误:Every derived table must have its own alias
Every derived table must have its own alias 派生表都必须有自己的别名 一般在多表查询时,会出现此错误. 因为,进行嵌套查询的时候子查询出来的的结果是作为一个 ...
- mysql出现错误“ Every derived table must have its own alias”
Every derived table must have its own alias 这句话的意思是说每个派生出来的表都必须有一个自己的别名 一般在多表查询时,会出现此错误. 因为,进行嵌套查询的时 ...
- 【MySQL】mysql出现错误“ Every derived table must have its own alias”
Every derived table must have its own alias 这句话的意思是说每个派生出来的表都必须有一个自己的别名 一般在多表查询时,会出现此错误. 因为,进行嵌套查询的时 ...
- Every derived table must have its own alias
完整错误信息如下: Every derived table must have its own alias 三月 28, 2017 10:20:46 上午 org.apache.catalina.co ...
- Mysql错误:Every derived table must have its own alias
Mysql报错:Every derived table must have its own alias <缺少一个别名> 在子查询中经常会犯的错误 .这个别名其实没啥用途.... ...
随机推荐
- Intellij IDEA 15 如何同时打开多个项目
标题:Intellij IDEA 15 如何同时打开多个项目 作者原创技术文章,转载请注明出处 我们在编程时常常需要打开多个项目,例如操作复制黏贴或者参考其他项目等等,但是编译器Intellij ID ...
- instanceof、isInstance、isAssignableFrom的区别
https://stackoverflow.com/questions/3949260/java-class-isinstance-vs-class-isassignablefrom 1. MyCla ...
- vue中如何获取后台数据
原文链接:http://blog.csdn.net/vergilgeekopen/article/details/68954940 需要引用vue-resource 安装请参考https://gith ...
- CF 375C Circling Round Treasures [DP(spfa) 状压 射线法]
C - Circling Round Treasures 题意: 在一个$n*m$的地图上,有一些障碍,还有a个宝箱和b个炸弹.你从(sx,sy)出发,走四连通的格子.你需要走一条闭合的路径,可以自交 ...
- ASP.NET Core 入门
关于ASP.NET Core ASP.NET Core 是一个全新的开源.跨平台框架,可以用它来构建基于网络连接的现代云应用程序,比如:Web 应用,IoT(Internet Of Things,物联 ...
- 全球(局)唯一标识符GUID的使用
1.GUID百科介绍: 1.全局唯一标识符(GUID,Globally Unique Identifier)也称作 UUID(Universally Unique IDentifier) .GUID是 ...
- ubuntu的网络配置
1,检查网络是否通畅 ping www.baidu.com 2,检查网线是否插好 3,使用ifconfig查看当前活跃网络接口 ifconfig 4,配置IP地址.子网掩码.网关地址 sudo vi ...
- 通过读取配置文件,启动mongodb
在实际的项目中,经常利用mongodb数据库做缓存,mongodb的并发性比较高,所以对于快速存储.读取信息有很多优点.在项目中对于第一次的数据请求会直接访问数据库,而对于获得的信息通常都会在此时刻存 ...
- python进阶学习笔记(三)
3.类的继承 3.1,python中什么是类的继承 答案是肯定的. 也就是说,如果一个实例是一个子类,那么它也是一个父类 总是从某各类继承,如果没有合适的类,就要从object类继承:super(). ...
- url路径去掉两个opencms
采用刚刚的方法安装OpenCMS之后,站点url中会存在两个opencms,造成访问url路径过长,下面讲解一种去掉两个opencms的方法. 1.去掉第一个opencms 安装时采用ROOT安装,即 ...