相关疑难解决方法(0)

SQLSTATE [42000]:语法错误或访问冲突:1055 SELECT列表的表达式#3不在GROUP BY子句中并包含nonaggregated

当我将ubuntu从15.10升级到16.04时,我在yii2项目中有这个错误

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #3
of SELECT list is not in GROUP BY clause and contains nonaggregated column 
'iicityYii.opportunity_conditions.money' which is not functionally dependent 
on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Run Code Online (Sandbox Code Playgroud)

正在执行的SQL是:

SELECT SUM(oc.money),op.id,oc.money,
            op.mantaghe,
            op.`time`, op.`id`, `op`.`logo`,
           `pd`.`user_id`, `op`.`name`, 
           `pd`.`co_name`, `op`.`address`, 
           `op`.`project_type_id`, `op`.`state_id`
FROM `opportunity` op 
INNER JOIN `profile_details` pd  ON op.user_id=pd.user_id  
INNER JOIN `opportunity_conditions` oc ON   op.id=oc.opportunity_id
GROUP BY `op`.`id`
ORDER BY `op`.`id` DESC
Run Code Online (Sandbox Code Playgroud)

怎么解决我的问题?

mysql ubuntu yii2

29
推荐指数
5
解决办法
5万
查看次数

标签 统计

mysql ×1

ubuntu ×1

yii2 ×1