adspace


can anybody tell us, how to select 2nd max salary from
table.
my id is ashish.akk@gmail.com

Answer Posted / darshan shah

select top 1 * from (select top 2 * from emp order by sal
desc ) a order by sal asc



Plz try this.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

You have a stored procedure, which execute a lengthy batch job. This stored procedure is called from a trigger you do not want to slow the data entry process you do not want trigger to wait for this batch job to finish before it completes itself what you can do to speed up the process?

1213


what is spatial nonclustered index

1058


How to convert numeric expression data types using the cast() function?

1149


What is subquery? Explain the properties of a subquery?

1059


What is a coalesce function?

1283


List out the different types of locks available in sql server?

1050


What are wait types?

1249


Explain “row_number()” in sql server with an example?

1079


What is self contained sub query?

1140


Can you index views?

954


Why we use the openxml clause?

1079


What is a view in sql?

1040


What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?

1197


Can we shrink data file in sql server?

1128


Is it possible to have clustered index on separate drive from original table location?

1040