how to find nth highest salary

Answer Posted / ayush sharma

select sal from (select distinct sal from emp order by desc)
where rownum <=n minus select sal from(select distinct sal
from emp order by desc) where rownum<=n-1;

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Name few of the dcl commands in sql?

552


Explain triggers in sql?

558


Explain what is public role in sql server?

580


Explain how many types of relationship?

575


What are the database roles? : sql server security

566






How can we migrate from SQL server to SQL Azure?

92


What is a primary key?

538


Explain what is the purpose of sql profiler in sql server?

554


What is difference between Datepart() and Datename() in SqlServer?

720


What is spid in sql server profiler?

538


Can we call future method from trigger?

514


What purpose does the model database server?

657


How to add additional conditions in SQL?

590


Tell me what do you mean by an execution plan? Why is it used? How would you view it?

530


What is cursors?

642