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

what is loop in frameworkmanager ?

4 Answers   Texas,


what are the names of the reports that you prepared?

0 Answers   IBM,


HOW TO DEVELOPE THE DRILLTHROUGH REPORTS?

4 Answers   IBM, TCS,


What is the difference between cognos 8.2 and cognos 8.3?

5 Answers  


actually my qus is i used some tables in my model,i published that to connection i use that one.at the same way my team member added some new tables and again he published how can i get my model in connection pls pls explain me..........

1 Answers  






How to write a condition for multy select in conditional formatting... Eg:- i added list,crosstab, barchart, columchart, guagechart, pie chart for value prompt by using static choices.. if i select multiple that all the things has to be display.. this is requirement how is possible to display..

2 Answers   IBM,


what are typees of dimensions

5 Answers   HCL,


What condition do we use in Cognos when multiple path exits to reach the fact table.(i.e in BOXI we use CONTEXT when multiple path exit)

0 Answers  


How do you Parametermap variables in Quiries?

0 Answers   TCS,


what are the enhancements in cognos reportnet ?

9 Answers   IBM, TCS,


Give me any example of semi and non additive measures?

0 Answers  


how can you get the errors in job? when loops are araised we get error?

0 Answers   Syntel,


Categories