how to find nth highest salary
Answer Posted / harshal
Below query is written assuming table "employee" has a column called "salary".
select salary from (select salary from (select distinct(salary) from employee order by salary desc)where rownum<n) order by salary asc where rownum<1;
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to throw custom exception in Stored Procedure?
How to execute a stored procedure in ms sql server?
Do you know what is fill factor and pad index?
How do I partition a table in sql server?
You have modified 100 store procedures and want to replicate these changes from development to prodution, and production can have users using the Server/DB, how would you replicate without causing issues?
John exports information periodically from a microsoft sql server database to an oracle database what is the best way to do this?
How do I uninstall sql server 2014?
What are the options which must be set to allow the usage of optimistic models?
What are the differences between char and varchar in ms sql server?
Is it safe to delete log files?
What are the basic functions for master, msdb, model, tempdb and resource databases?
What is bookmark link in ssrs?
Why are sql functions used?
What are the types of subscriptions in SQL Server replication?
How to return the top 5 rows from a select query in ms sql server?