当前位置:网站首页>mysql 查询报错
mysql 查询报错
2022-07-17 12:55:00 【夏安code】
Expression #1 of ORDER BY clause is not in SELECT list, references column 'X1.t0.name' which is not in SELECT list; this is incompatible with DISTINCT
这一般是mysql版本问题造成的。
临时解决:
select version();
select @@global.sql_mode 查询sql_mode
set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
永久解决:
修改my.cnf,去掉ONLY_FULL_GROUP_BY参数:
添加sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
数据库表字段字符集不同的查询报错,首先查看创建表的sql,或者看表结构的字符集是什么样子,然后修改一致,
ALTER table table_name COLLATE=utf8mb4_general_ci, convert to CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
边栏推荐
- C language structure to realize simple address book
- 基于JSP的小说写作与创作网站
- Design of the multi live architecture in different places of the king glory mall
- C语言自定义类型详解
- 2022 Zhejiang secondary vocational group "Cyberspace Security" code information acquisition and analysis (full version)
- Design and Simulation of intelligent storage cabinet control system
- Pytorch框架 学习记录1 CIFAR-10分类
- Map遍历 key-value 的4种方法
- AutoJs学习-多功能宝箱-中
- Job: enter an odd number of 1-100
猜你喜欢

Develop the first Flink app

C语言自定义类型详解
![[PostgreSQL] PostgreSQL 15 optimizes distinct](/img/18/5aaae76c1c269960defc7db8a9e63f.png)
[PostgreSQL] PostgreSQL 15 optimizes distinct

LeetCode 2249. 统计圆内格点数目

SAP Fiori 的附件处理(Attachment handling)

Structure the combat battalion | module 7

Feature level fusion in Bev space

开发第一个Flink应用

爱可可AI前沿推介(7.17)

2022 windows penetration test of "Cyberspace Security" of Hunan secondary vocational group (ultra detailed)
随机推荐
王者荣耀商城异地多活架构设计
IP SAN拥有独立的文件系统,应用服务器通过网络共享协议访问到IP SAN后,可以对文件系统中的文件进行读写操作
unity3d中的旋转
AutoJs学习-动态解密
电商销售数据分析与预测(日期数据统计、按天统计、按月统计)
Effectively understand FreeSQL wheredynamicfilter and deeply understand the original design intention [.net orm]
Three programming implementations to quickly determine whether the site is alive
Through middle order traversal and pre order traversal, the subsequent traversal will always build a binary tree
[PostgreSQL] PostgreSQL 15 optimizes distinct
HCIA review and answer 2022.7.6
[makefile] some notes on the use of makefile
Avi 部署使用指南(2):Avi 架构概述
String type function transfer problem
NJCTF 2017messager
【牛客刷题】/*C语言实现字符串左旋*/
[Niuke swipe questions] / *c language realizes left-hand rotation of strings*/
如何使用SVG制作沿任意路径排布的文字效果
线程池原理
LeetCode 2335. 装满杯子需要的最短总时长
R language uses R native functions to aggregate transforms, calculate window statistics, calculate min, and merge the generated statistical data into the original data set