Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Can sql servers linked to other servers?

976


How to use user defined functions in expressions?

1009


How to concatenate two character strings together?

1058


Where are sql server user names and passwords stored in sql server?

1018


Explain the ways to controlling cursor behavior?

876


How can we use ConnectorJ JDBC Driver with MS SQL?

955


How to recreate an existing index in ms sql server?

987


What is federation member?

114


What is join and name different type of joins?

976


What is use of attributehierarchyenabled? : sql server analysis services, ssas

1163


What is bcp? When does it used?

923


How is sql used in sql server?

944


How can we remove orphan records from a table?

933


What are joins in sql and what are the different types of joins?

964


How to create percentile function?

139