sql - Some sqlplus errors -
when run following code,
select count_ee_cnum.counts + count_eefaculty.counts + count_cs_cnum.counts + count_cs_faculty.counts ( select count(ex.cnum) counts enrolled ex ex.cnum in ( select distinct ex.cnum faculty fx, faculty fy, class cx, class cy, enrolled ex, enrolled ey fx.dept = 'ee' , fy.dept = 'cs' , cx.fid = fx.fid , cy.fid = fy.fid , ex.cnum = cx.cnum , ey.cnum = cy.cnum)) count_ee_cnum, (select count(fx.dept) counts faculty fx fx.dept = 'ee') count_ee_faculty, (select count(ey.cnum) counts enrolled ey ey.cnum in ( select distinct ey.cnum faculty fx, faculty fy, class cx, class cy, enrolled ex, enrolled ey fx.dept = 'ee' , fy.dept = 'cs' , cx.fid = fx.fid , cy.fid = fy.fid , ex.cnum = cx.cnum , ey.cnum = cy.cnum)) count_cs_cnum, (select count(fy.dept) counts faculty fy fy.dept = 'cs') count_cs_faculty;
the sqlplus gives me error says
where fy.dept = 'cs') count_cs_faculty * error @ line 3: ora-00933: sql command not ended
i have tried many ways eliminate error, however, seems not working.
to focus purely on actual error you're getting, error @ line 3
bit of giveaway, line highlighted line 23.
sql*plus treats blank line end of statement:
a blank line in sql statement or script tells sql*plus have finished entering command, not want run yet.
the first 20 lines of script being ignored; seen 3 separate statements end (with blank line) never run. last 3 lines fourth independent statement, run, because of terminating semicolon. , statement incomplete, obviously.
you can either remove blank lines script, or change how sql*plus treats them, adding set sqlblanklines on
script before query.
of course, you'll need address issues others have raised (whole) query doing, that's separate subject.
Comments
Post a Comment