文章详情页
mysql - sequel Pro中如何设置group by语句跑出来的结果默认该组的第一条记录
浏览:233日期: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)取第一行记录再连接原表获取你要的结果
相关文章:
1. boot2docker无法启动2. node.js - antdesign怎么集合react-redux对input控件进行初始化赋值3. 关于docker下的nginx压力测试4. python - for循环print怎样才能输出csv呢5. python2.7 - Python安装模组不成功6. mysql - sql数据还原7. node.js mysql Cannot find module "net" 和 "tls"和"fs" 的问题8. MySQL客户端吃掉了SQL注解?9. python from fileutils import FileUtils文件操作10. mysql 一条语句多种count如何写
排行榜

网公网安备