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

What is a Query Subject?

756


What is called cognos reporting tool?

685


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

1759


What is difference between primary key and unique key constraints?

657


Write some methods to apply securities in framework manager model?

749






What is a Cube?

784


What is difference between page break and section report?

802


What are the different uses of a repository manager?

684


which type of project we r going to snowflake schema

1665


hi friends pls forward impropmtu interview question

1787


What's the limitation of 'Page Footer' in Report Studio? e.g. If I have an activity prompt (list of activities in a Search & Select Prompt) and selected around 2500 activites from the 'Activity' Search & Select Prompt and when I ran the report I got a message "#! Overflow" in page footer. Can somebody please tell me what's max. limit. I tried with around 300 activities and page footer displayed the activities. Your help will be appriciated.

2236


write a query to display the departments with no employee?

1632


how u burst the reports? if u r bursted reports is not reached to destination how u identify???

10960


what is the difference between querystudio in reportnet and cognos8

1814


Diff b/w Crossproduct and Outerjoin?

1916