文章详情页
mysql - sequel Pro中如何设置group by语句跑出来的结果默认该组的第一条记录
浏览:182日期:2022-06-10 14:50:46
问题描述
select age,money from t1.gz group by age;发现报错:Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ’t1.gz.money’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
问题解答
回答1:你现在的sql_mode不允许有非聚合字段以非聚合函数的形式出现,改一下sql_mode即可,或者min(id)取第一行记录再连接原表获取你要的结果
相关文章:
排行榜
