only_full_group_by
-
[mysql] ERROR 1055... which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_byDatabase/mysql 2021. 6. 10. 15:33
mysql에서 날짜별 통계 관련 쿼리문을 작성할때 group by를 자주 사용하게 된다. 평소에 하던대로 쿼리를 짜서 콘솔에 테스트를 해보니 아래와 같은 에러가 발생했다. ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'date' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 에러 원인은 'only_full_group_by' 때문이다. 그래서 쿼리문을 수정하던지, 아니면 없애면 된다. 없애는..
-
[solved] ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'db.table.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_byDatabase/mysql 2020. 9. 23. 10:15
mysql에서 sql문에 'GROUP BY'를 사용하는데 아래와 같은 에러가 발생했다. ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'db.table.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 쉽게 말하자면 sql_mode=only_full_group_by로 되어 있으면 잘못된 GROUP BY 사용을 제한한다. 엄격하게 용도에 맞게 사용 됐을때만 쿼리가 성공한다. 나의 경우 테이..