how to find the second highest salary from emp table?

Answer Posted / bibin__edappal

select salary from empTable where salary = (select
max(salary )from empTable where salary < (select max(salary
) from empTable))

OR

select salary from empTable where salary = (select
max(salary )from empTable where salary NOT IN (select
max(salary ) from empTable))

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different categories of sql commands?

632


What is join view in sql?

515


What is the use of index in sql?

557


How do I count rows in sql?

561


In a distributed database system, can we execute two queries simultaneously?

569






what is a unique key ? : Sql dba

547


what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?

2005


Is it possible to Restore a Dropped Table using Rollback Command in Oracle SQL Plus ?

720


What are joins in sql?

539


explain normalization concept? : Sql dba

590


Is big data nosql?

514


Are stored procedures faster than queries?

524


what happens if null values are involved in expressions? : Sql dba

564


How does cross join work in sql?

535


How can a function retun more than one value in oracle with proper example?

586