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

Once reports are delivered to client, how will they inform back? If they are experiencing any problem in the reports.

2 Answers  


what is cognos architechure

4 Answers   Cap Gemini,


Usage of Stored Procedures in Cognos

1 Answers   General Motors GM, TCS,


what is the difference between count and running-count functions?

1 Answers  


----------0Diff b/w Report Functions and Database functions?

1 Answers   IBM,


How do we create row level security in cognos8?

3 Answers  


-------------How you design DWH?

0 Answers   Bank Of America,


what are typees of dimensions

11 Answers   HCL,


4. How many dimensions did you use in your reports?

0 Answers   IBM,


i have taken quantity on ANx-axis & months on y-axis(months r not in oreder )when i run the reoprt i need months in proper order .how can i do this ?

0 Answers  


What is Tool Tip? and how to create in report studio?

1 Answers   Wipro,


How to Improve the Performance of the Report? i need this urgently .

4 Answers   HSBC,


Categories