搜索
mysql - sequel Pro中如何设置group by语句跑出来的结果默认该组的第一条记录
PHP中文网
PHP中文网 2017-07-07 10:35:36
[MySQL讨论组]

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

PHP中文网
PHP中文网

认证0级讲师

全部回复(1)
曾经蜡笔没有小新

你现在的sql_mode不允许有非聚合字段以非聚合函数的形式出现,改一下sql_mode即可,或者min(id)取第一行记录再连接原表获取你要的结果

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板