我正在尝试写一个PL/SQL
函数来返回第N个最高薪水。我一直收到运行时错误。错误在'返回结果;'线
PL / SQL:ORA-00933:SQL命令未正确结束ORA-06575:包或函数GETNTHHIGHESTSALARY处于无效状态
码:
CREATE FUNCTION getNthHighestSalary(N IN NUMBER) RETURN NUMBER IS result NUMBER;
BEGIN
select Salary into result
from
(select dense_rank() over (order by salary desc) as Ranks, ID, Salary
from Employee) a
where a.Ranks = N
RETURN result;
END;
你丢失了分号qazxsw poi。它应该是qazxsw poi