write a query for the fifth highest salary?

Answers were Sorted based on User's Feedback



write a query for the fifth highest salary?..

Answer / arshi

SELECT MAX(Salary) AS Expr1
FROM TableName
WHERE (Salary NOT IN
(SELECT TOP (4) MAX(Salary)
AS Expr1
FROM TableName AS
TableName_1
GROUP BY Salary
ORDER BY SalaryDESC))

Is This Answer Correct ?    6 Yes 7 No

write a query for the fifth highest salary?..

Answer / ramesh

select top 1 salary

(select distinct top 5

salary from employees

order by salary desc)

a order by salary

Is This Answer Correct ?    6 Yes 9 No

write a query for the fifth highest salary?..

Answer / sujit

Hop it helps!

Select sal from (select sal from emp order by sal desc
where rownum<6);

Is This Answer Correct ?    0 Yes 3 No

write a query for the fifth highest salary?..

Answer / payal

select salary from emp order by salary desc limit 4,1

Is This Answer Correct ?    3 Yes 10 No

write a query for the fifth highest salary?..

Answer / aravind

select * from (select sal from emp order by desc) emp where
rownum = 5

Is This Answer Correct ?    6 Yes 14 No

write a query for the fifth highest salary?..

Answer / p.chella vijaya

select top 5 (salary) from emp order by desc

Is This Answer Correct ?    1 Yes 13 No

write a query for the fifth highest salary?..

Answer / p.chella vijaya

select top 5 (salary) from emp order by salary desc

Is This Answer Correct ?    1 Yes 14 No

Post New Answer

More Databases AllOther Interview Questions

in informatica workflow has 5 sessions and running seqentially and 3rd session has been failed how can we run again from only 3rd to 5th session

1 Answers  


Write a query to get maximum and second maximum in oracle?

0 Answers   CGI,


What is the role of driver manager?

0 Answers  


What is the difference between specialization and generalization?

0 Answers   BirlaSoft,


What do you mean by cluster and non cluster index?

0 Answers  






how to send multiple records which matches all the condition in the lookup transformation ? (if lookup matches the codition for duplicate values)

0 Answers  


define primary key index, bitmap index, hash index,virtual indwx

0 Answers   Cap Gemini,


Can you create a database in word?

0 Answers  


How many types of locks are present in a database?

0 Answers   Abacus,


what are different types of datasets? what are different characteristics or properties of those datasets? what are the advantages and disadvantages of each dataset on each other?

1 Answers   OVGU,


What do you mean by database?

0 Answers  


WHAT IS THE PURPOSE OF TESTING INTEGRITY OF THE UNIVERSE?

0 Answers   Wipro,


Categories