mysql数据库版本问题(mysql8报的错,mysql5.7就没问题):
select * from adopt group by animal_id;
以上语句报错:
1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'xmanimalmanager.adopt.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sqlmode=onlyfullgroupby
,在navicat新建查询中输入以下语句:
SET GLOBAL sqlmode='STRICTTRANSTABLES,NOENGINE_SUBSTITUTION';
navicat连接右击→关闭连接,再重新连接,再输入sql语句就成功了