how to find nth highest salary

Answer Posted / premsagar12

SELECT DISTINCT(A.SAL),ENAME FROM EMP A WHERE &N=(SELECT
COUNT(DISTINCT(B.SAL )) FROM EMP B WHERE A.SAL<=B.SAL);

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention a few common trace flags used with sql server?

616


How to create a Master database in SQL server ?

642


Name 3 of the features that the sql server built-in function loginproperty performs on standard logins? : sql server security

787


How do you maintain database integrity where deletions from one table will automatically cause deletions in another table?

810


What are types of scd? : sql server analysis services, ssas

632






what is a mixed extent? : Sql server administration

685


What are the types of dml?

641


what is difference between NULL and ISNULL in SQL Server 2008?

663


How to get @@error and @@rowcount at the same time?

666


What is the definition for sql server 2000?

687


Write a query for primary key constraint with identity key word?

652


what are triggers? : Sql server database administration

573


What do you mean by 'normalization'?

700


What is the use of nvl work?

655


Your table has a large character field there are queries that use this field in their search clause what should you do?

584