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
Is sql server a database?
List the different types of joins?
What are the differences between having and where clause.
Define indexes?
do you know what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration
What is difference between stored procedure and user defined function?
Is candidate a key?
What is a view and what are its advantages?
If user is owning any SQL Objects, can we drop that user
What are relationships and mention different types of relationships in the dbms
what is isolation level at dead lock?
hi, the following are the outputs of sp_spaceused and sp_tempdbspace sp_spaceused ------------ database size unallocated size tempdb 77752.95 MB 28026.99 MB sp_tempdbspace ------------- database size spaceused tempdb 77752.945312 1.007812 the unused space in sp_spaceused is nearly 28 Gb and in sp_tempdbspace is nearly 76 Gb cany any one explain about this output and why its giving different results.
What is store procedure? How do they work?
what is an extended stored procedure? : Sql server database administration
How to create indexed view?