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

Answer Posted / tejasvita dhuri

select id,salary from (select id,salary,ROW_NUMBER()over (order by salary desc) as rowcol from emp)A
where A.rowcol=2

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pl sql record in oracle?

563


What are the types of index in sql?

531


Why we use triggers in mysql?

557


What is a .db file?

538


Explain ddl statements in pl/sql?

576






what are all the different types of indexes? : Sql dba

526


explain advantages of myisam over innodb? : Sql dba

595


what is the difference between nested subquery and correlated subquery?

547


What is an index? What are the types of indexes? How many clustered indexes can be created on a table?

551


What are all types of user defined functions?

524


Do foreign keys improve performance?

543


how to fetch common records from two tables? : Sql dba

625


How does postgresql compare to oracle/db2/ms sql server/informix?

563


Can we use distinct and group by together?

586


Explain what is a view?

596