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
Explain the difference between control flow and data flow?
How to apply filtering criteria at group level with the having clause in ms sql server?
How do I view a trc file?
‘Order by’ is not allowed in a view how can you sort information from a view?
what is an extended stored procedure? Can you instantiate a com object by using t-sql? : Sql server database administration
How to concatenate two strings in SQL Server.
What are the recovery models for a database?
How global temporary tables are represented and its scope?
Can one drop a column from a table?
What stored by the master?
Write down the syntax and an example for create, rename and delete index?
What is the difference between primary key and unique constraints?
What Are the Main Features of SQL Azure?
How to see the event list of an existing trigger using sys.trigger_events?
What is the difference between online clustering and Offline clustering?