次のコードを実行すると、
select count_ee_cnum.counts + count_eefaculty.counts + count_cs_cnum.counts + count_cs_faculty.counts
from
( select count(Ex.cnum) as counts
from enrolled Ex
where Ex.cnum in (
select distinct Ex.cnum
from faculty Fx, faculty Fy, class Cx, class Cy, enrolled Ex, enrolled Ey
where Fx.dept = 'EE' and Fy.dept = 'CS' and Cx.fid = Fx.fid and Cy.fid = Fy.fid and Ex.cnum = Cx.cnum and Ey.cnum = Cy.cnum)) count_ee_cnum,
(select count(Fx.dept) as counts
from faculty Fx
where Fx.dept = 'EE') count_ee_faculty,
(select count(Ey.cnum) as counts
from enrolled Ey
where Ey.cnum in (
select distinct Ey.cnum
from faculty Fx, faculty Fy, class Cx, class Cy, enrolled Ex, enrolled Ey
where Fx.dept = 'EE' and Fy.dept = 'CS' and Cx.fid = Fx.fid and Cy.fid = Fy.fid and Ex.cnum = Cx.cnum and Ey.cnum = Cy.cnum)) count_cs_cnum,
(select count(Fy.dept) counts
from faculty Fy
where Fy.dept = 'CS') count_cs_faculty;
SQLPLUSでエラーが表示されます
where Fy.dept = 'CS') count_cs_faculty
*
ERROR at line 3:
ORA-00933: SQL command not properly ended
このエラーを解消するために多くの方法を試しましたが、うまくいかないようです。