query writing using PL/SQL procedure

Employee table
=====================================================
create table employee(id number(10),name varchar2(20),designation varchar2(20),salary number(10));



1)))
Selecting second max salary from employee
--------------------------------------------------------------------

procedure:-
-----------------------------------------------------------
create procedure second_highest1(b out varchar2)
   is
   begin
   select max(salary) into b from employee where salary!=(Select               max(salary) from employee);
   end;

   /

Program To Call The Procedure:-
--------------------------------------------
declare
b varchar2(20);
begin
second_highest1(b);
dbms_output.put_line(b);
end;
/

set serveroutput on;

Comments

Popular posts from this blog

Git Commands With Output Log

Java Interview Preparation (conceptual)

Java 8 Function Interface