mysql 5.7 groupby报错

2016-11-28 18:28:00
hainuo
原创 1072
摘要:1055:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'shengxinwang.card_bonus_new.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by [ SQL语句 ] : SELECT * FROM `card_details_new` WHERE `id` = '00001' GROUP BY newId ORDER BY id desc LIMIT 0,12
> 1055:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'shengxinwang.card_bonus_new.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by [ SQL语句 ] : SELECT * FROM `card_bonus_new` WHERE `hybh` = '00001' GROUP BY newhy ORDER BY id desc LIMIT 0,12 今天将之前公司做好的一套程序拿来修改客户需求,发现以上问题 产生原因在于mysql5.7 的严格模式 修改方式为处理sqlmode 在数据库连接后执行 ``` set sql_mode=''; ```