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

Answer Posted / dhaval

we have to use distinct key word there is a possibility
that two person having same salary.



select top 1 sry from (select distinct top 2 sry from emp
order by sry desc)t1 order by sry asc

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are system databases into sql server (2005/2008) : sql server database administration

553


In what three ways is the return statement used in a stored procedure?

504


What information is maintained within the msdb database?

527


What happens if strings are casted into wrong code pages in ms sql server?

549


How will you decide the active and passive nodes?

624






How to perform backup for certificates in sql server? : sql server security

583


What is candidate key with example?

496


What stored procedure can you use to display the current processes?

484


What is difference between index and primary key?

572


What is #table in sql server?

522


What do mean by xml datatype?

603


How to execute a sql statement using odbc_exec()?

556


What is ssl in sql server?

535


What is clustered primary key?

534


What does man by sql wildcard characters in sql server?

507