how to calcuate the second highest salary of he employee

Answer Posted / hari krishna j

SELECT A.SAL FROM EMP_TAB A
WHERE 1=(SELECT COUNT(*) FROM EMP_TAB B
WHERE B.SAL > A.SAL)

Change value of 1 if
0 - First heighest sal
1 - Second " "
2 - Third heighest sal
.
.
.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is datawarehouse? : Sql dba

579


Why left join is used in sql?

533


Is ms sql is free?

540


What are the constraints available in sql?

592


Define concurrency control. : Transact sql

593






What are the types of variable use in pl sql?

577


What is sql entity?

538


What are character functions?

642


what are sequences

1111


What does := mean in pl sql?

568


What is sql and how does it work?

557


What does 0 mean in sql?

536


What does partition by mean in sql?

521


What is java sql connection?

520


How do we use distinct statement? What is its use?

564