MySql教程

【MySQL】Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre

本文主要是介绍【MySQL】Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1.登录MySQL

打开cmd,输入:

mysql -uroot -p

回车后输入密码,即进入

2. 更改global.sql_mode

select @@global.sql_mode

查询出来的值为:

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_SUBSTITUTION

去掉ONLY_FULL_GROUP_BY,重新设置值。

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';
这篇关于【MySQL】Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!