当前位置:网站首页>MySQL error: expression 1 of select list is not in group by claim and contains nonaggre
MySQL error: expression 1 of select list is not in group by claim and contains nonaggre
2022-07-02 03:58:00 【Snow pine】
Catalog
An error is as follows :
Expression #2 of SELECT list is not in GROUP BY clause and contains
nonaggregated column ‘sss.month_id’ which is not functionally
dependent on columns in GROUP BY clause; this is incompatible with
sql_mode=only_full_group_by
The cause of the problem :
MySQL 5.7.5 And the above functions depend on the detection function , If enabled ONLY_FULL_GROUP_BY SQL Pattern ( By default ),MySQL Selection list will be rejected ,HAVING Condition or ORDER BY The query reference of the list is in GROUP BY Unnamed non set column in clause , It doesn't depend on them in function .(5.7.5 Before ,MySQL No functional dependency detected , Not enabled by default ONLY_FULL_GROUP_BY, of 5.7.5 A description of the previous behavior , Please see the “MySQL 5.6 Reference manual ”.)
Solution 1 :
open navcat, use sql Inquire about :
select @@global.sql_modeThe value of the query is :
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONGet rid of ONLY_FULL_GROUP_BY, Reset value .
set @@global.sql_mode
=’STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’;Here's the picture :

Solution 2 :
The steps to success :
vim open :
sudo vim /etc/mysql/conf.d/mysql.cnfScroll to the bottom of the file, copy and paste
[mysqld]
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONTo the bottom of the file , Save and exit input mode
sudo service mysql restartrestart MySQL, complete ! Here's the picture :

--------------------------------------------------------------------------------------------------------
The environment I use is docker Container of lnmp Mirror image
Mirror address :2233466866/lnmp - Docker Image | Docker Hub
https://hub.docker.com/r/2233466866/lnmp
github Address :Home · 2233466866/lnmp Wiki (github.com)
https://github.com/2233466866/lnmp
Running commands :
# Pull the mirror image
docker pull 2233466866/lnmp
# Container generation
docker run -dit \
-p 80:80 \
-p 443:443 \
-p 3306:3306 \
-p 9000:9000 \
-v /home/user/www:/www \
-v /home/user/mysql:/data/mysql \
--privileged=true \
--name=lnmp \
# Container self starting ,--restart=no It is not self starting
--restart=always \
2233466866/lnmp【 End 】
边栏推荐
- SQL:常用的 SQL 命令
- Object oriented thinking
- VS2010插件NuGet
- Which product of anti-cancer insurance is better?
- Déchirure à la main - tri
- The 10th Blue Bridge Cup single chip microcomputer provincial competition
- C语言:逻辑运算和判断选择结构例题
- Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
- The original author is out! Faker. JS has been controlled by the community..
- 蓝桥杯单片机数码管技巧
猜你喜欢
![[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!](/img/46/d36ae47c3d44565d695e8ca7f34980.jpg)
[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!

集成底座方案演示说明

蓝桥杯单片机第四届省赛

Raspberry pie GPIO pin controls traffic light and buzzer

Qt插件之Qt Designer插件实现

The 11th Blue Bridge Cup single chip microcomputer provincial competition

Installation and use of blue lake
![[untitled]](/img/53/cb61622cfcc73a347d2d5e852a5421.jpg)
[untitled]

0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed

蓝桥杯单片机省赛第十二届第二场
随机推荐
Interface debugging tool simulates post upload file - apipost
Fourier series
蓝桥杯单片机第六届温度记录器
Lost a few hairs, and finally learned - graph traversal -dfs and BFS
微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
The 8th Blue Bridge Cup single chip microcomputer provincial competition
ImageAI安装
高性能 低功耗Cortex-A53核心板 | i.MX8M Mini
[personal notes] PHP common functions - custom functions
BiShe cinema ticket purchasing system based on SSM
go 分支与循环
[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
pip 安装第三方库
The first game of the 12th Blue Bridge Cup single chip microcomputer provincial competition
《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
A thorough understanding of the development of scorecards - the determination of Y (Vintage analysis, rolling rate analysis, etc.)
Welcome the winter vacation multi school league game 2 partial solution (B, C, D, F, G, H)
Demonstration description of integrated base scheme
Wechat applet - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
Oracle viewing locked tables and unlocking