文章詳情頁
mysql - sequel Pro中如何設(shè)置group by語句跑出來的結(jié)果默認(rèn)該組的第一條記錄
瀏覽:137日期: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 - node.js promise沒用2. golang - 用IDE看docker源碼時(shí)的小問題3. c++ - 如何正確的使用QWebEngineView?4. yii2中restful配置好后在nginx下報(bào)404錯(cuò)誤5. javascript - js 寫一個(gè)正則 提取文本中的數(shù)據(jù)6. 算法 - python 給定一個(gè)正整數(shù)a和一個(gè)包含任意個(gè)正整數(shù)的 列表 b,求所有<=a 的加法組合7. android 如何實(shí)現(xiàn)如圖中的鍵盤上的公式及edittext的內(nèi)容展示呢8. java - 我在用Struts2上傳文件時(shí),報(bào)以下錯(cuò)誤怎么回事?9. php自學(xué)從哪里開始?10. 網(wǎng)站被黑,請教下大神,怎么對datebase.php內(nèi)容加密。
排行榜

熱門標(biāo)簽