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

Answer Posted / sohail

select empno,ename,sal
from (select ename,empno,sal,dense_rank()
over(order by sal desc)topn
from emp)
where topn=2

Is This Answer Correct ?    69 Yes 46 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I run a pl sql procedure in sql developer?

502


What is sql used for?

632


What are sql injection vulnerabilities?

491


What is the sql query to display the current date?

538


what is data manipulation language? : Sql dba

517






What is consistency?

694


Explain what is a field in a database and record in a database?

596


How do I find duplicates in sql?

493


What is the use of & in pl sql?

523


what are the advantages of sql ? : Sql dba

531


what is the difference between primary key and unique key? : Sql dba

515


Write a unique difference between a function and a stored procedure.

516


can a stored procedure call itself or recursive stored procedure? : Sql dba

567


How do you declare a user-defined exception?

522


What is execution plan in sql?

540