GROUP BY 查詢總報(bào)錯(cuò)
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'yatest.user2.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
2018-03-17
檢查一下你的 select 的字段 ,取消里面不能分組的字段。
2018-03-26
謝謝 江南一號(hào)的回覆與解釋
我不明白的是,套以下的函示寫出你說的 "?select status, count(*) from user where id<=10 group by status "?該怎麼寫?
是?print_r($PdoMySQL->find($tables,'id>=5','count(*)','status'));會(huì)出現(xiàn)錯(cuò)誤?
還是需要修改ParsFields函式?如何改?抱歉阿,我真的還是基礎(chǔ)班的....
2018-03-21
出現(xiàn)一樣的問題,當(dāng)執(zhí)行這句? print_r($PdoMySQL->find($tables,'id<=10','*','status'));
出現(xiàn)這樣的錯(cuò)誤訊息:
SQLSTATE : 42000?
SQL Error : Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'imooc.user.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Error SQL : SELECT * FROM user WHERE id<=10 GROUP BY status
江南1號(hào)所說的“檢查一下你的 select 的字段 ,取消里面不能分組的字段”不太懂該怎麼做....求解,感謝先~