find the second highest salary of the emp table

Answer Posted / naresh

Here it is the simple solution.

Select Salary from (Select Salary, Rownum from Employee
order by Salary desc) where rownum=2

Should Work
Cheers!
Naresh

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we store images in oracle database?

555


What are the different oracle database objects?

588


What is oracle data type?

555


How to pass parameters to procedures?

555


In XIR2 if we lost the administration password .How can we regain the password?thanks in advance.

1470






How to define an external table with a text file?

579


How to commit the current transaction in oracle?

578


Where do we use decode and case statements?

564


How to recover a dropped table in oracle?

609


How can we force the database to use the user specified rollback segment?

562


> CREATE OR REPLACE FUNCTION FACTORIAL_1(factstr varchar2 ) 2 RETURN NUMBER AS 3 new_str VARCHAR2(4000) := factstr||'*' ; 4 fact number := 1 ; 5 BEGIN 6 7 WHILE new_str IS NOT NULL 8 LOOP 9 fact := fact * TO_NUMBER(SUBSTR(new_str,1,INSTR(new_str,'*')-1)); 10 new_str := substr( new_str,INSTR(new_str,'*')+1); 11 END LOOP; 12 13 RETURN fact; 14 15 END; explanation Above program?

1571


How to connect to oracle using service name instead of sid?

553


When system tablespace is created?

606


Can we write dml statement in function in oracle?

638


How to create a new user account in oracle?

584