文章詳情頁
mysql - sequel Pro中如何設(shè)置group by語句跑出來的結(jié)果默認(rèn)該組的第一條記錄
瀏覽:132日期:2022-06-10 14:50:46
問題描述
select age,money from t1.gz group by age;發(fā)現(xiàn)報(bào)錯(cuò):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:你現(xiàn)在的sql_mode不允許有非聚合字段以非聚合函數(shù)的形式出現(xiàn),改一下sql_mode即可,或者min(id)取第一行記錄再連接原表獲取你要的結(jié)果
相關(guān)文章:
1. javascript - vue-router怎么不能實(shí)現(xiàn)跳轉(zhuǎn)呢2. python - 模擬滑動(dòng)驗(yàn)證碼,有源碼,求解3. html5 - angularjs中外部模版加載無法使用4. javascript - js 寫一個(gè)正則 提取文本中的數(shù)據(jù)5. javascript - [WDS] Disconnected! 一直重復(fù)出現(xiàn)。6. java - 安卓電視盒子取得了root權(quán)限但是不能安裝第三方應(yīng)用,請(qǐng)問該怎么辦?7. 老哥們求助啊8. css3 - 請(qǐng)問一下在移動(dòng)端CSS布局布局中通常需要用到哪些元素,屬性?9. 想寫一個(gè)python分析統(tǒng)計(jì)apache 日志文件的腳本10. 我的Apache卡在這里不動(dòng)了怎么辦?
排行榜

熱門標(biāo)簽