我有3张桌子
CREATE TABLE airships(
idas number PRIMARY KEY,
nameas varchar2(20),
range number
);
CREATE TABLE Certificate(
idem number NOT NULL,
idas number NOT NULL,
FOREIGN KEY (idem) REFERENCES employees(idem),
FOREIGN KEY (idas) REFERENCES airships(idas)
);
CREATE TABLE employees(
idem number PRIMARY KEY,
nameem varchar2(20), paycheck number
);
我必须找到那些使用子查询和opratos认证的最大数量飞艇的员工,例如EXISTS,IN,ALL,ANY
我设法只找到一名员工,而不用任何oparatos。
Select *
from (Select idem,count(idas) as AirshipName
From Certificate
Group By idem
Order By count(idas) DESC)
WHERE ROWNUM=1