內查詢如下,工作正常獨立甲骨文,添加子查詢
select graduate.univid
from graduate, projectmanager, university
where graduate.empid = projectmanager.mgrid and rownum = 1
group by graduate.univid
order by count(graduate.univid) desc;
但是當把作爲子查詢,ORACLE sqlplus中不斷給「缺少右括號」錯誤
select university.univname
from university
where exists
(
select graduate.univid
from graduate, projectmanager, university
where graduate.empid = projectmanager.mgrid and rownum = 1
group by graduate.univid
order by count(graduate.univid)
);
時缺少右括號
我已經檢查了計算器類似的問題,但並不能真正幫助您使用
你的查詢看起來不正確的各種各樣的原因。它缺少一個連接條件(你應該總是使用顯式的'JOIN')。當您只提取一行時,您正在進行彙總。 –