当满足以下条件时,我尝试使用 select 语句返回行:
第一个条件:员工的 EMPLOYEE_HOME_ORG 不等于 396000 或 396010 并且 DEGREE_HIERARCHY 小于 40 并且 FACULTY_DEGREE_CODE 不等于 'MS' 或 'MA'
条件二:员工的DEGREE_HIERARCHY小于40,员工的FACULTY_SUBJECT_CODE和FACULTY_DEGREE_CODE不在SUBJ_CODE_CROSSWALK表中。
我收到以下错误:
ORA-00920: invalid relational operator
请参阅下面的代码,非常感谢任何帮助!
SELECT V.FACULTY_DEGREE_CODE,
V.FACULTY_SUBJECT_CODE,
I.EMPLOYEE_DEPARTMENT_HOME_ORG,
MAX(D.DEGREE_HIERARCHY)
FROM V_DEGRESS V
JOIN DEGREE_CROSSWALK D
ON V.FACULTY_DEGREE_CODE =
D.DEGREE_CODE
JOIN I_REPORT_DETAILS I
ON V.PIDM = I.HR_PIDM
LEFT JOIN SUBJ_CODE_CROSSWALK S
ON V.FACULTY_DEGREE_CODE =
S.FACULTY_DEGREE_CODE
LEFT JOIN SUBJ_CODE_CROSSWALK S
ON S.FACULTY_SUBJECT_CODE =
V.FACULTY_SUBJECT_CODE
WHERE V.PERSON_SKEY = 12345
AND
(
(I.EMPLOYEE_DEPARTMENT_HOME_ORG != 396000
and I.EMPLOYEE_DEPARTMENT_HOME_ORG != 396010)
and (d.DEGREE_HIERARCHY < 40 )
and
(V.FACULTY_DEGREE_CODE != 'MS' and
V.FACULTY_DEGREE_CODE != 'MA')
)
--and NOT ONE SUBJ CODE CROSSWALK
AND
(
(D.DEGREE_HIERARCHY < 40)
AND
(V.FACULTY_SUBJECT_CODE,
V.FACULTY_DEGREE_CODE NOT IN
(SELECT S.FACULTY_SUBJECT_CODE,
S.FACULTY_DEGREE_CODE
FROM SUBJ_CODE_CROSSWALK
S
WHERE S.FACULTY_SUBJECT_CODE =
V.FACULTY_SUBJECT_CODE
AND V.FACULTY_DEGREE_CODE =
S.FACULTY_DEGREE_CODE
)
)
)
GROUP BY V.FACULTY_DEGREE_CODE,
V.FACULTY_SUBJECT_CODE,
I.EMPLOYEE_DEPARTMENT_HOME_ORG