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
Is sql server free?
What is cursor in ms sql server?
What is the difference between writing data to mirrored drives versus raid5 drives
Define full outer join?
Where are stored procedures in sql server?
What is cached report?
What is the difference between Clustered and Non-Clustered Index?
Which database stores information about replication?
What is difference between inner join and join?
Can sql servers linked to other servers like oracle?
Mention the 3 ways to get a count of the number of records in a table.
What is etl - extraction, transformation, and loading?
Do you think BCNF is better than 2NF & 3NF? Why?
If I delete a template from the list in sql studio, will it be deleted from the hard disk? : sql server management studio
Suppose i have a table that contains 5 columns like col1,col2...colm5.I want to import only two column through BCP utility.How to do same through BCP in sybase.