当我运行以下代码时,
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
我已经尝试了很多方法来消除这个错误,但是,它似乎不起作用。