find out the second highest salary?

Answer Posted / raghu

second highest salary department wise query would be this

select e.dept_id,e.salary,e.emp_name,e.rank from (select
dept_id,emp_name,salary,dense_rank() over (partition by
dept_id order by salary desc nulls last) rank
from employee)e
where e.rank = 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 an Oracle Instance?

685


What is the fastest query method to fetch data from the table?

863


How to start a new transaction in oracle?

587


Can you create a synonym without having a table?

553


What is the scope of a local variable?

585






In not less than 100 words what's the main difference between Rolap and Molap in ORACLE ?

1777


Is insert autocommit in oracle?

601


What is a initialization parameter file in oracle?

584


How to create a stored procedure in oracle?

573


I am using an Oracle 8i Database my data contains Clob data. I am using toad version 7.6 i am able to get the data in toad but unable to extract the data in excel.when trying to extract the data into the excel the toad error says out of memory. Can any body please help me to extract the data through the same toad version. Thanks in advance

1844


What is ceil and floor in oracle?

573


How to define a variable of a specific record type?

607


Which is better Oracle or MS SQL? Why?

5433


What do you mean by merge in oracle?

591


What is SQL access advisor in Oracle?

630