当我运行一条联合查询的sql语句时报如下错误:

[Err] 1248 - Every derived table must have its own alias,大概意思是每一张派生表必须要有自己的别名。这里加上别名即可。

原先sql:

select * from t_test t1 where t1.content like '%test%'
Union all
select * from
(select * from t_test t2 where t2.content not like '%test%' order by t2.content asc);

加上别名之后:

select * from t_test t1 where t1.content like '%test%'
Union all
select * from
(select * from t_test t2 where t2.content not like '%test%' order by t2.content asc) d;

再运行一遍之后问题解决

【mysql报错】[Err] 1248 - Every derived table must have its own alias的更多相关文章

  1. [Err] 1248 - Every derived table must have its own alias

    问题描述 [Err] 1248 - Every derived table must have its own alias 问题原因 这句话的意思是说每个派生出来的表都必须有一个自己的别名 我的Mys ...

  2. MySql 1248 - Every derived table must have its own alias

    执行一个sql语句,报错:1248 - Every derived table must have its own alias 提示说每一个衍生出来的表,必须要有自己的别名 执行子查询的时候,外层查询 ...

  3. (转载)1248 - Every derived table must have its own alias

    (转载)http://hi.baidu.com/lylegend13/item/a79f17eb51f5dff7e0a5d43b 1. select count(distinct CName) fro ...

  4. 错误代码: 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 ...

  5. 【MYSQL】MYSQL报错解决方法: Warning: (3719, "'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8M B4 in a future release."

    用python3.6.5创建mysql库时出现如下报错,虽然报错,但是数据库可以插入成功. D:\python3\lib\site-packages\pymysql\cursors.py:170: W ...

  6. MySQL 报错

    SELECT COUNT(1) FROM (select tid from teacher where tname like '李%') 1248 - Every derived table must ...

  7. 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 ...

  8. mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY

    mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY 今天开发的同事发来如下错误信息,最最简 ...

  9. sql查询报错:Every derived table must have its own alias

    执行sql语句出现语法错误 Every derived table must have its own alias 翻译:每个派生表都有自己的别名

随机推荐

  1. Mysql增量备份之Mysqldump&Mylvmbackup

    简单介绍 备份类型 备份方式 热备份:备份期间不需要服务停机,业务不受影响: 温备份:备份期间仅允许读的请求: 冷备份:备份期间需要关闭Mysql服务或读写请求都不受影响: 完全备份:full bac ...

  2. TKinter容器frame使用

    容器frame使用布局 https://www.cnblogs.com/anita-harbour/p/9315472.html TK控件使用大全 https://blog.csdn.net/rng_ ...

  3. OverLoad怎么用

    首先给出一个实例 package practice3; public class TryOverLoad { public static void main(String[] args) { Syst ...

  4. [译]ASP.NET:WebForms vs MVC

    原文示例(VS2012): 1.  Download Simple WebForm demo - 6.7 KB 2.  Download Simple MVC Demo demo - 1.5 MB 介 ...

  5. 在ASP.NET中备份数据库以及还原(不成熟)

    using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...

  6. Ant Design Pro 改变默认启动端口号

    找到package.json文件,找到图位置加--port即可.

  7. go-爬段子

    爬取搞笑的段子,横向爬取+纵向爬取 横向爬取爬页数,纵向爬取,爬每页的内容 package main import ( "fmt" "io" "net ...

  8. 使用Kubernetes进行ProxySQL本机群集

    自v1.4.2起,ProxySQL支持本机群集.这意味着多个ProxySQL实例可识别群集; 他们了解彼此的状态,并能够通过根据配置版本,时间戳和校验和值同步最新的配置来自动处理配置更改. Proxy ...

  9. JS简单数据类型

    JS数据类型 在计算机中,不同的数据所需要占用的空间是不同的,为了便于把数据分析称所需内存大小不同的数据,充分利用存储空间,于是定义了不同的数据类型 简单数据类型 简单数据类型 说明 默认值 Numb ...

  10. Android 组件化最佳实践 ARetrofit 原理

    本文首发于 vivo互联网技术 微信公众号 https://mp.weixin.qq.com/s/TXFt7ymgQXLJyBOJL8F6xg作者:朱壹飞 ARetrofit 是一款针对Android ...