• 카테고리

    질문 & 답변
  • 세부 분야

    데이터 분석

  • 해결 여부

    해결됨

set 2 4번

21.02.28 01:01 작성 조회수 203

1

set 2 4번 문제에서 group by 에 company_code 와 founder 두개를 사용했는데 founder를 빼면 다음과 같은 에러가 나옵니다.

ERROR 1055 (42000) at line 1: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'run_5mv96ezra6f.A.founder' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

founder의 경우에도 group by 에 넣어주어야 되는 이유가 있을까요?
가령 left join 의 왼쪽에 해당되는 열은 group by에 모두 적어야 된다는 것과 같은 특별한 이유가 있을까요?

founder의 경우 수를 세는 것이 아니라 단순 출력을 하기 위함이고 company_code만으로도 count에 대한 결과물은 얻을 수 있어 궁금합니다.

답변 1

답변을 작성해보세요.

0

안녕하세요!

아래 문서가 에러에 대한 설명을 잘 해주고 있으니 읽어보시고, 추가 질문 있으시면 해주세요 :)

검색은 써주신 에러메시지에서 특정 컬럼명만 제외하고 모두 복사하여 구글에 검색했습니다. 앞으로도 에러메시지를 보고 검색하실 때 참고가 되길 바랍니다.

'ERROR 1055 (42000) at line 1: Expression #2 of SELECT list 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'

https://developyo.tistory.com/20

서정원님의 프로필

서정원

질문자

2021.03.02

조금 더 찾아보고 질문 드릴 걸 그랬네요 ㅠ 이해 되었습니다. 감사합니다!