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


Please Help Members By Posting Answers For Below Questions

what’s the difference between Covering Indexes and Clustered Indexes ? how to use clustered index small ?

1581


What is change data capture (cdc) feature?

596


What does it mean to normalize data?

525


What is a view and what are its advantages?

694


Can you create a logon trigger in sql server 2005 express edition?

579






Explain different types of BACKUPs avaialabe in SQL Server? Given a particular scenario, how would you go about choosing a backup plan?

584


What is not null constraint?

630


Explain trigger classes i.e. Instead of and after trigger?

495


What is normalization and its types?

544


Is it safe to delete log files?

531


What is the command used to check locks in microsoft sql server?

549


you accidentally delete the msdb database what effect does this have on your existing sql databases, and how do you recover? : Sql server administration

725


What is difference between rownum and row_number?

523


write an SQL query to list the employees who joined in the month of January?

1155


What are synonyms?

531