当前位置:网站首页>MYSQL:Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column

MYSQL:Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column

2022-06-12 18:09:00 DXIANGH

reason :select Columns to query Not included in group by clause
solve
Method 1 : All fields queried are matched to gruop by Clause
Method 2 : Modify database settings
1.

  select @@global.sql_mode
	2.`@@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’`

3. Restart the database
Method 3 : Use ANY_VALUE() function
Such as : Insert picture description here

原网站

版权声明
本文为[DXIANGH]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206121801562591.html