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

Answer Posted / reddy

select distinct (a.sal) from emp a where &n = (select count
(distinct(b.sal) from emp bmwhere a.sal<=b.sal)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does an execution block start and end in pl sql?

502


What is the usage of nvl function?

601


What is the use of count (*) in sql?

553


What is the current version of postgresql?

562


How many unique keys can a table have?

563






What is the reports view in oracle sql developer?

545


Is record in oracle pl sql?

535


What is the difference between in and between in sql?

578


Can we create clustered index without primary key?

525


What is the difference between having clause and where clause?

575


Can we rename a column in the output of sql query?

545


What are different types of triggers?

565


What are different types of keys?

529


What is the use of pl/sql table?

559


What are sql*plus environment variables?

559