How to retrieve a second highest salary from a table?
Note:Suppose salaries are in duplicate values
eg:
Name Sal
Malli 60000
Pandi 60000
Rudra 45000
Ravi 45000

Answer Posted / rajat

SELECT * FROM (
SELECT RANK()OVER( ORDER BY SALARY DESC) NUM, A.* FROM RAJ A)
WHERE NUM=2;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is nosql example?

583


What is the difference between null value, zero, and blank space?

556


What is rtm stands for?

579


what are string data types? : Sql dba

511


Is drop table faster than truncate?

549






describe transaction-safe table types in mysql : sql dba

509


What are basic techniques of indexing?

846


What found sql?

521


What is the difference between cross join and natural join?

564


Explain raise_application_error.

644


what is the use of double ampersand (&&) in sql queries?

624


What is package in pl sql with an examples?

547


What is indexes?

542


What is difference between inner join and self join?

591


what is a record in a database ? : Sql dba

566