当前位置:网站首页>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;
边栏推荐
- SAP ABAP CDS view 视图的 Replacement 技术介绍
- bazel使用教程 转
- Bazel use tutorial to
- 读已提交级别下 注解事务+分布式锁结合引起的事故--活动购买机会的错乱
- 从“被动”到“主动”,ZETA技术助力“RFID2.0”升级该如何实现?
- Figure an introduction to the interpretable method of neural network and a code example of gnnexplainer interpreting prediction
- 如果是用mybatics去访问达梦数据库,相当于完全一样了?因为SQL语法没变。对吧?
- 创建虚拟机第一章(vmvare虚拟机)
- 多元线性回归详解
- IP SAN拥有独立的文件系统,应用服务器通过网络共享协议访问到IP SAN后,可以对文件系统中的文件进行读写操作
猜你喜欢

机器学习模型的评估方法

Convert excel table to word table, and keep the formula in Excel table unchanged

Pytorch学习记录2 线性回归(Tensor,Variable)

string类的介绍及模拟实现

NJCTF 2017messager

Know what it is, and know why, JS object creation and inheritance

LeetCode 2335. 装满杯子需要的最短总时长

看一看这丑恶嘴脸 | MathWorks Account Unavailable - Technical Issue

电商销售数据分析与预测(日期数据统计、按天统计、按月统计)

How to solve the problem of cross domain access by Google browser
随机推荐
Redis集群、一主二从三哨兵的搭建
C# SerialPort配置和属性了解
二叉树刷题(二)
C # treeview tree structure recursive processing (enterprise group type hierarchical tree display)
双向NAT技术
2022年全国最新消防设施操作员(中级消防设施操作员)模拟试题及答案
分类任务中的类别不平衡问题
Avi 部署使用指南(2):Avi 架构概述
树的基本操作
华为防火墙认证技术
Takeout ordering system based on wechat applet
创建虚拟机第一章(vmvare虚拟机)
破案了卧槽---从MQ消费的逻辑怎么改代码都不生效
金鱼哥RHCA回忆录:CL210描述OPENSTACK控制平面--识别overclound控制平台服务+章节实验
华为机试:报文解压缩
Autojs learning - multi function treasure chest - bottom
C serialport configuration and attribute understanding
STL中stack和queue的使用以及模拟实现
Crud code practice of user management based on koa2 + MySQL
Pytorch框架 学习记录1 CIFAR-10分类