서버/DB
mysql group by error
아카이sun
2018. 9. 21. 13:56
Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column '컬럼명' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
만약 해당 오류가 난다면 mysql strict mode와 관련이 있다.
sql mode 보기
- show variables like 'sql_mode';
my.cnf에 sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION" 이런식으로 적용하면 된다.