how to calcuate the second highest salary of he employee

Answer Posted / eshwer

Try this
select * from (SELECT empno,sal, DENSE_RANK() OVER (ORDER BY sal desc) AS SalRnk
FROM scott.emp) where salrnk=2;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql exception?

513


Why sql query is slow?

573


How to process query result in pl/sql?

555


How do I view a view in sql?

501


Can a key be both primary and foreign?

504






What is a function in oracle pl sql?

532


how is exception handling handled in mysql? : Sql dba

545


Is sql workbench free?

523


How do I sort a table in sql?

587


What is compute?

553


What is the purpose of my sql?

501


List the various privileges that a user can grant to another user?

570


Hi how to import oracle sequence in Informatica? Please write stored procedure code that will import oracle sequence in Informatica SP transformation as per below scenario Oracle table product list Pro_id, pro_name 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights Now a new flat file with new product list needs to be added to oracle table product list with oracle sequence. flat file product Prono,pro_name, 1, 20 watt tube light 2, 30 watt tube light & target should be like 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights. 104, 20 watt tube light 105, 30 watt tube light thks reg suvarna joshi suvarnaatsuvarna@rediffmail.com

2058


What is the use of function "module procedure" in pl/sql?

658


Why partition by is used in sql?

548