I am trying to mimic the query(for academical purpose)
(select course_id from section where semester = 'Spring' and year = 2010)
intersect
(select course_id from section where semester = 'Fall' and year = 2009)
Successfully mimicked with
select t.course_id from section t, section s where s.course_id = t.course_id and
s.semester = 'Spring' and s.year = 2010 and t.semester = 'Fall' and t.year = 2009;
and when I tried these,
select t.course_id from section t, section s where s.course_id = t.course_id and
(s.semester, s.year, t.semester,t.year) in ('Spring',2010,'Fall',2009);
error at the parenthesis after
in
predicate(as per the row and column mentioned in error), error is ORA-00920: invalid relational operator 00920. 00000 - "invalid relational operator"
then I tried
select t.course_id from section t, section s where
s.course_id = t.course_id and (s.semester,s.year) = ('Spring',2010)
and (t.semester, t.year) in ('Fall',2009);
select t.course_id from section t, section s where
s.course_id = t.course_id and ((s.semester,s.year) in ('Spring',2010))
and ((t.semester, t.year) = ('Fall',2009));
with different combination of in
and =
getting the same error at parenthesis after the first in
or =
Is there a limit in mentioning attributes for (..) in/= (...)
or using the same table causes this or some other reason?
using Oracle 12c.