두 개의 liferay 테이블 — users_
및 expandovalue
—에 대해 오른쪽 외부 조인을 수행하여 결과 집합을 얻으려고합니다.ON 절이 하위 쿼리가있는 두 테이블의 오른쪽 외부 조인
모든 사용자에 대해 다음 쿼리를 수행했을 때 원하는 결과가 나타납니다.
SELECT USER_.FIRSTNAME
, USER_.LASTNAME
, USER_.EMAILADDRESS
, USER_.JOBTITLE
, expandovalue.data_
from expandovalue
right outer join
user_ on expandovalue.classpk = user_.userid
and expandovalue.columnid =35695;
사용자 집합 (사용자 그룹의 일부)에 대해 동일한 작업을 시도한 경우 오류가 발생했습니다. 아래 조회 :
SELECT USER_.FIRSTNAME
, USER_.LASTNAME
, USER_.EMAILADDRESS
, USER_.JOBTITLE
, expandovalue.data_
from expandovalue
right outer join
user_ on expandovalue.classpk
in (select userid
from user_
where userid
in (select userid
from users_usergroups
where usergroupid = 40073
) and status =0) = user_.userid in
(select userid
from user_
where userid
in (select userid
from users_usergroups
where usergroupid = 40073
)
and status =0
) and expandovalue.columnid =35695
여기에 특정 사용자 그룹에있는 사람들의 userid
의를 제공하는 하위 쿼리입니다.
(select userid
from user_
where userid in
(select userid
from users_usergroups
where usergroupid = 40073)
and status =0
)
완전히 잘못된 방향으로 가고 있습니까? 제발 조언.
1. 검색어에 'AND'가 누락되었습니다. ... 및 상태 = 0) = 미소 ** AND ** user_.userid ... 2. 어떤 데이터베이스를 사용하고 있습니까? – lleite
백엔드에서 Oracle 10g를 사용 중입니다. 정확히 어디인지 그리고없는 것입니다. 감사합니다 lleite – user1666444
게시하기 좋은 아이디어는 오류 메시지를 포함시키는 것입니다. 다음 번에는 참고하시기 바랍니다. 스택 오버플로에 오신 것을 환영합니다 – RichardTheKiwi