how to find nth highest salary

Answer Posted / rabi

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

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the restrictions while creating batches in sql server?

587


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

716


What is sql server english query?

547


Where are stored procedures in sql server?

566


What is indexing explain it with an example?

555






What is forward - only cursors / read only cursor?

523


If no size is defined while creating the database, what size will the database have?

550


Define constraints and give an example of their use?

565


What is Service Broker in sql server 2012?

624


Where sql server user names and passwords are stored in sql server? : sql server database administration

586


Do you know what is sql service broker?

540


What is the difference between delete and truncate statements?

576


List the different normalization forms?

546


Write an sql query to sort a table according to the amounts in a row and find the second largest amount.

568


What is data set in report?

97