以前在mysql5.7上执行如下sql语句没有问题

SELECT DISTINCT u.*,c.content userCategory FROM m_user u LEFT JOIN m_category c ON u.user_category=c.category_id LEFT JOIN m_user_role mr ON u.user_id=mr.user_id WHERE 1=1 AND u.user_status=0 ORDER BY u.createtime DESC LIMIT 10

使用mycat 1.6.6.1后执行上面的sql语句报错如下:

1 queries executed, 0 success, 1 errors, 0 warnings

查询:SELECT DISTINCT u.*,c.content userCategory FROM m_user u LEFT JOIN m_category c ON u.user_category=c.category_id LEFT JOIN m_use...

错误代码: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*, c.content
ORDER BY u.createtime DESC
LIMIT 10' at line 5

执行耗时 : 0 sec
传送时间 : 0 sec
总耗时 : 0.008 sec

后来把mycat上执行的语句改为如下语句(把 distinct后的 * 号改为u表的每个字段)执行成功:

SELECT DISTINCT u.user_id,u.user_name,u.user_pwd,u.user_realname,u.user_email,u.mobile_phone,u.office_phone,u.user_category,u.user_subcategory,u.user_status,u.createtime,u.updatetime,u.createuser,u.user_ip,u.user_odm_id,c.content userCategory  FROM m_user u LEFT JOIN m_category c ON u.user_category=c.category_id LEFT JOIN m_user_role mr ON u.user_id=mr.user_id WHERE 1=1 AND u.user_status=0 ORDER BY u.createtime DESC LIMIT 10

mycat 1.6.6.1 distinct报错问题的更多相关文章

  1. Django使用distinct报错:DISTINCT ON fields is not supported by this database backend

    具体错误提示是:django.db.utils.NotSupportedError: DISTINCT ON fields is not supported by this database back ...

  2. mycat未配置对应表导致报错

    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: can't find table define in sch ...

  3. mycat偶尔会出现JVM报错double free or corruption并崩溃退出

    mycat偶尔会出现JVM报错double free or corruption并崩溃退出 没有复杂的sql,也没有大量的io INFO | jvm | // :: | *** Error in `j ...

  4. mycat启动报错UnknownHostException(Temporary failure in name resolution)解决方法

    重启命令 ./mycat restart 查看日志 cd logs tail -f wrapper.log 报错信息 INFO | jvm 2 | 2018/05/09 11:28:28 | Erro ...

  5. mycat登录报错Host 'XXX' is blocked because of many connection errors的另一种解决思路

    报错时机 使用了mycat,而不是单纯使用了mysql. 报错信息 ERROR 1129 (HY000): Host '1.23.22.18' is blocked because of many c ...

  6. Mycat分布式数据库架构解决方案--配置defaultAccount属性报错解决方案

    echo编辑整理,欢迎转载,转载请声明文章来源.欢迎添加echo微信(微信号:t2421499075)交流学习. 百战不败,依不自称常胜,百败不颓,依能奋力前行.--这才是真正的堪称强大!!! 该文章 ...

  7. mycat重启报错Failed to connect to the Wrapper at port解决方法

    报错信息 ERROR | wrapper | 2018/05/11 14:01:55 | Startup failed: Timed out waiting for a signal from the ...

  8. mysql基于“报错”的注入

    报错是如何转为xss的? mysql语句在页面报错,泄露信息 ===================================================================== ...

  9. 报错注入分析之(count()、rand()、group by)分析,被大佬称为floor报错注入

    PS:在这几天的学习当中很多的文章都将此注入方式称之为“floor报错分析”但经过我这几天的学习.个人觉得不该如此称呼!若君有意请详细阅读此篇文章.特别感谢米怀特的开导,说句实在的研究这个注入有四天了 ...

随机推荐

  1. 135. Candy(Array; Greedy)

    There are N children standing in a line. Each child is assigned a rating value. You are giving candi ...

  2. UITextView设置占位文字

    这里只介绍一种,这种方便扩展,可以占位文字颜色. 我们继承一个UITextView: #import <UIKit/UIKit.h> @interface MyTextView : UIT ...

  3. 更改IDEA高亮字体背景颜色

    IDEA工具中依次进入file -> settings -> editor -> colors Scheme -> general,在右侧窗口中将result.i  都改成自己 ...

  4. 集合_java集合框架

    转载自http://blog.csdn.net/zsw101259/article/details/7570033 Java集合框架图 简化图: Java平台提供了一个全新的集合框架.“集合框架”主要 ...

  5. SqlServer垂直分表 如何减少程序改动

    当单表数据太多时,我们可以水平划分,参考 SqlServer 分区视图实现水平分表 ,水平划分可以提高表的一些性能. 而 垂直分表 则相对很少见到和用到,因为这可能是数据库设计上的问题了.如果数据库中 ...

  6. Qt程序无法输入中文的问题

    问题 在Linux环境下,用Qt编写的程序运行时不能在诸如输入框.文本框中输入中文(不会激活中文输入法). 注意与输入法类型有关(基于iBus或Fcitx) 原因 Qt程序的中文输入支持需要用Qt插件 ...

  7. linux下两台服务器文件实时同步方案实现-乾颐堂

    假设有如下需求: 假设两个服务器: 192.168.0.1 源服务器  有目录 /opt/test/ 192.168.0.2 目标服务器  有目录 /opt/bak/test/ 实现的目的就是保持这两 ...

  8. Siverlight MarkerSize 控制数据点半径大小 LineThickness 控制点与点之间直线的厚度

    using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI ...

  9. mysql:查询数据库版本的几种方式

    Mysql版本: 登入数据库的时候: select @@version; select version(); mysql> select @@version; +-----------+ | @ ...

  10. How to add a date range picker to filter for dates on a GridView for Yii2 - See more at: http://www.2amigos.us/blog/how-to-add-a-date-range-picker-to-filter-for-dates-on-a-gridview-for-yii2#sthash.pf7

    Filtering the data we have on our GridView by dates are sometimes very important. On this article I ...