can anybody tell us, how to select 2nd max salary from
table.
my id is ashish.akk@gmail.com
Answer Posted / sabin v jacob
SELECT Min(Sal) FROM (SELECT TOP 2 Sal FROM emp ORDER BY
Sal desc) as Temp
or
SELECT Min(Sal) FROM emp WHERE Sal IN(SELECT TOP 2 Sal FROM
emp ORDER BY Sal DESC)
| Is This Answer Correct ? | 5 Yes | 3 No |
Post New Answer View All Answers
What options are there to delete rows on the publisher and not on the subscriber? : sql server replication
What is difference between rollback immediate and with no_wait during alter database?
How are the unique and primary key constraints different?
What is reference section?
What is the guest user account in sql server? What login is it mapped to it? : sql server security
Can we take the full database backup in log shipping?
What is set nocount on and what is set nocount off?
How secure is sql server database?
what is hash nonclustered index
What happens when the SQL Azure database reaches Max Size?
How to change parameter value inside the report?
Explain hostprotectionattribute in sql server 2005?
Explain difference between cross join and full outer join?
Explain the various types of concurrency problem?
Why use triggers?