Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to find a 3rd highest salary using pseudocolumns in a stored procedure from employees table

User_35O2QAug 31 2022

I tried
create or replace procedure highest_salary(v_salary out number)
as
v_rnk number;
begin
select d.* from (select rownum rnk into v_rnk from (select distinct salary into v_salary from employees order by salary desc))d
where d.rnk=v_rnk;
end ;
/

i am getting error like this,
LINE/COL ERROR
-------- -----------------------------------------------------------------
5/1 PL/SQL: SQL Statement ignored
5/48 PL/SQL: ORA-01744: inappropriate INTO

kindly tell me the solution , how to make it.

Comments
Post Details
Added on Aug 31 2022
5 comments
1,366 views