GROUP BY 함수를 쓰면서 select 절에 그 많은 필드가 왜 필요한가요?
group by는 계산함수에 의해 처리된 값을 group화 합니다.
쿼리에서 얻으려는 결과가 무엇인가요?
그리고 documents와 tags 테이블간의 join에 대한 어떤 조건도 보이지 않는데
이것도 좀 이상하고....
현쓰 님이 쓰신 글 :
: 아래 쿼리가 동작되게 하려면 어떻게 해야 할까요?
: select 할 필드가 "documents".* 이라 group by 시 문제가 되는것 같습니다.
: group by에 필드를 모두 적어주면 동작을 하겠지만...
: 필드가 53개인데 다 적어서 해봤는데... 오류메세지도 안나오고 결과물도 안나옵니다.
: 이런 경우 어떻게 처리 하나요?
:
: SELECT FIRST 20 SKIP 0
: "documents".*
: FROM
: "xe_documents" as "documents",
: "xe_tags" as "tags"
: Where
: ("documents"."module_srl" in (58) and
: "documents"."document_srl" = "tags"."document_srl"
: and "tags"."tag" like '%%') and
: "documents"."list_order" < 2100000000
: GROUP BY
: "documents"."document_srl"
: ORDER BY "documents"."list_order" asc
:
: 위 쿼리 실행시 오류 메세지
: SQL error code = -104.
: Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause).
|