how to find nth highest salary
Answer Posted / amit
select * from emp as e1 where sal (n-1) = select distinct
(count(*) from emp as e2 where e2.sal>e1.sal)
Where n is no that u want which postion's salary u want
suppose second higest means n=2
Amit
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Can one drop a column from a table?
what is the difference between openrowset and openquery?
What are a scheduled jobs?
How can you start sql server in different modes?
What is TDS(Tabular Data Stream) Gateway?
Difference between DELETE and TRUNCATE?
What is an expensive query?
How to execute multiple stored procedures at one time in sql server?
What are key constraints?
Explain different types of locks in sql server.
What is mean by candidate key?
How can you find out which stored procedures are recompiling?
How to add code to the existing article (using improve article)?
How to assign null values to variables or columns?
What are the system database in sql server 2005?