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

How do I find duplicates in the same column?

525


How do I count rows in sql query?

484


Explain two easy sql optimizations.

595


How to read xml file in oracle pl sql?

500


How do I order columns in sql?

522






What does the sign mean in sql?

497


Is nosql relational?

540


Can you do multiple joins in sql?

538


What is sqlca in db2?

523


how would you enter characters as hex numbers? : Sql dba

507


What do you understand by case manipulation functions?

539


How many tables can a sql database have?

526


Can pl sql procedure have a return statement?

544


How do I truncate a word?

514


how many sql ddl commands are supported by 'mysql'? : Sql dba

518