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

Answer Posted / vsandhyana

Hi Hashmatulla Baig,

I think your query will not give the desired output. it
should be modify please refer below for the same.

SELECT empno, sal
FROM
(
select empno, sal, (ROW_number() OVER (order by sal desc)) R
from emp
order by sal desc
)
WHERE R = 5;

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do we drill through from a powerplay cube to reportnet?\

1881


1)diff between shortcut-key and alias table? 2)what is unit testing? 3)what is scorecard?

3096


what are the special features in cognos reportnet?

608


Write some methods to apply securities in framework manager model?

646


How can create users and permissions in cognos?

554






-----------------What is Direct and Conventional loading?

1641


explain how to create powerplay reports?

604


What is the complex report you faced in real time?

1722


Can anyone give me the url for cognos forum which is similar to forumtopics.com/busobj for business objects?

1620


What is the difference between Open Connection command ang Open Session Command?

1912


What do you mean by drill through report?

572


What do you mean by query studio?

502


Define the cognos reporting tool?

542


If we are migrating lower version of Cognos reports (e.g. from Ver 7.0 to Cognos 8) then how we migrate Impromptu Catalog (ver 7.0) in Cognos 8? Do we create FM model for that? Please explain.

1701


------------- How to identify the Revenue Column in Report?

1812