文章詳情頁
mysql - sequel Pro中如何設置group by語句跑出來的結果默認該組的第一條記錄
瀏覽:146日期: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. angular.js - ngview配置路由失敗2. android - 優酷的安卓及蘋果app還在使用flash技術嗎?3. 黑客 - Python模塊安全權限4. android - 像支付寶到位這種點擊marker點擊變大怎么做的5. docker - 如何修改運行中容器的配置6. html5 - H5頁面喚起APP導航7. javascript - 正則表達式 w只匹配出一個字母,若要匹配出一個單詞,怎么寫?8. javascript - 關于ios微信端瀏覽器網頁的一些問題9. javascript - 可以左右滑動的導航菜單怎么實現10. javascript - react input file
排行榜
