Write a SQL query which should fetch the 5th maximum salary
of an employee from the table?

Answers were Sorted based on User's Feedback



Write a SQL query which should fetch the 5th maximum salary of an employee from the table?..

Answer / prashant

SELECT min(salary)
from emp
where salary in (select distinct top 5 salary from emp
order by salary desc)

Is This Answer Correct ?    1 Yes 3 No

Write a SQL query which should fetch the 5th maximum salary of an employee from the table?..

Answer / vsandhyana

select top 1 * from (select top 5 * from customers order by
salary desc) a order by salary asc

Thanks
Vikram Sandhyana

Is This Answer Correct ?    0 Yes 3 No

Write a SQL query which should fetch the 5th maximum salary of an employee from the table?..

Answer / rakesh

select rownum as rank,name,sal
from
( select name,sal from employees order by sal desc)
where
rownum=5

Is This Answer Correct ?    3 Yes 7 No

Write a SQL query which should fetch the 5th maximum salary of an employee from the table?..

Answer / pavan kumar

select * from emp e where 5=(select count(distinct sal)
from emp e where e.sal<=sal)

Is This Answer Correct ?    3 Yes 8 No

Post New Answer

More Cognos Interview Questions

how do you deploy a report in cognos 8 to run in maximo6? what r the steps in maximo??

0 Answers   IBM,


how u will design the report if the objects are available

0 Answers   Ness Technologies,


advantages of cascade prompt ???

7 Answers   iFlex, Oracle,


What are all types of Batches?

0 Answers  


What is model filter and query filter?

2 Answers   Wipro,






How you drill from powerPLay to Impromptu?Explain all Steps?

2 Answers  


How can we Maintain the Cube Security by Category level and Dimension level ?

0 Answers  


What is the difference between List and Cross tab? Could some on explain with an example..

2 Answers   Barclays,


What is use of Field Set present in toolbox?

1 Answers  


what is the difference between querystudio in reportnet and cognos8

0 Answers   CTS,


suppose if u r report having 1000 tables i want to dispaly alternate rows means 1,3,... how we specify that pleaes ans me

2 Answers  


What is slowely changing dimensions?why we are used SCD?

2 Answers  


Categories