当我运行一条联合查询的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. Reinforcement Learning by Sutton 第三章习题答案

    好不容易写完了 想看全部的欢迎点击下面的github https://github.com/LyWangPX/Solutions-of-Reinforcement-Learning-An-Introd ...

  2. 对于文本生成类4种评价指标的的计算BLEU METEOR ROUGE CIDEr

    github下载链接:https://github.com/Maluuba/nlg-eval 将下载的文件放到工程目录,而后使用如下代码计算结果 具体的写作格式如下: from nlgeval imp ...

  3. react 项目引入路由

    下载路由包 npm i react-router-dom -d 前台路由 登陆: /login /login.jsx App.js import React ,{Component} from 're ...

  4. kettle抽取数据发送邮件Linux调度

    kettle抽取数据发送邮件Linux调度 #1.进入kettle安装目录 然后执行sqoop.sh文件启动kettlecd /app/pdi-ce-7.1.0.0-12/data-integrati ...

  5. PHP实现微信提现(企业付款到零钱)

    怎么开通企业付款到零钱? 有的商户号的产品中心是没有这个功能的,不过,该功能的pid(product id)是5,只要随便进去某一个产品,在地址栏把pid改为5. 即可进入该功能页面,进行开通,不过要 ...

  6. stars-one的原创工具——APK签名验证破解工具

    ASCTool APk签名验证破解工具 APK Signature Crack Tool 本工具只对那些仅通过 PackageManager.getPackageInfo().signatures 来 ...

  7. spring boot项目记录--日志处理

    微信点餐用到的日志框架:slf4j(门面)+logback(框架) @RunWith(SpringRunner.class) @SpringBootTest @Slf4j public class L ...

  8. 这十个Python常用库,学习Python的你必须要知道!

    想知道Python取得如此巨大成功的原因吗?只要看看Python提供的大量库就知道了 包括原生库和第三方库.不过,有这么多Python库,有些库得不到应有的关注也就不足为奇了.此外,只在一个领域里的工 ...

  9. 页面QQ临时对话的实现

    一.开通QQ服务 点我进入QQ推广官网>然后点击推广工具即可后面自己看中文 二.页面a标签 <a target="_blank" href="http://w ...

  10. Oracle merge into的优势

    简介 Oracle merge into命令,顾名思义就是“有则更新,无则插入”,这个也是merge into 命令的核心思想,在实际开发过程中,我们会经常遇到这种通过两表互相关联匹配更新其中一个表的 ...