mysql8.0和链式操作group整一起就出错

浏览:2732 发布日期:2019/09/26 分类:ThinkPHP5专区
$list = BJ:: where('school',$school)
                ->where('ruxuenian','in',$ruxuenian)
                ->where('status',1)
                ->group('ruxuenian')
                ->field('id,ruxuenian')
                ->select();
在以前的mysql版本中没出现过个问题,现在却出现啦。
错误提示如下:
SQLSTATE[42000]: Syntax error or access violation: 1055 expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'chengji.cj_banji.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
群里朋友给出的方法是修改配置,如果不修改配置怎么整?
最佳答案
评论( 相关
后面还有条评论,点击查看>>