Write a query to get 2nd maximum salary in an employee table ?

Answer Posted / anil_abbireddy

select * from emp a where 2=(select count(distinct sal)
from emp b where a.sal<=b.sal)

Is This Answer Correct ?    30 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between 'between' & 'and' operators in sql

526


What do you mean by stored procedures?

545


How to start the command-line sql*plus?

562


What are literals in sql server?

530


What program will open a mdb file?

494






what is innodb? : Sql dba

575


How do you know if a relationship is 2nf?

518


What does truncate mean in sql?

534


What are the most important characteristics of pl/sql?

575


What are local and global variables and their differences?

582


What is sql stand for?

573


What is the use of partition by in sql?

514


Define a temp table?

553


How does one load ebcdic data? : aql loader

645


What is the purpose of cursors in pl/sql?

631