为了账号安全,请及时绑定邮箱和手机立即绑定

mysql> SELECT goods_id,goods_name FROM tdb_goods GROUP BY goods_name;

mysql> SELECT goods_id,goods_name FROM tdb_goods GROUP BY goods_name;

ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and c

ontains nonaggregated column 'imooc.tdb_goods.goods_id' which is not functionall

y dependent on columns in GROUP BY clause; this is incompatible with sql_mode=on

ly_full_group_by


正在回答

1 回答

SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

1 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
与MySQL的零距离接触
  • 参与学习       396886    人
  • 解答问题       3353    个

本课程涵盖全部MySQL数据库的基础,学习MySQL数据库的基础知识

进入课程

mysql> SELECT goods_id,goods_name FROM tdb_goods GROUP BY goods_name;

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信