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 / syaam

select a.sal from emp a
where 2=(select count(distinct b.sal) from emp b
where a.sal<= b.sal)


for getting nth max sal ..replace 2 by n


all the best

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between sql temp table vs table variable?

887


What is the difference between system objects and user objects?

1165


Where can you add custom error messages to sql server?

1127


What is the default order of an order by clause?

1001


What are the 10 characteristics of data quality?

956


What is BCP? When does it used in sql server 2012?

1066


What is read committed?

1095


How to execute stored procedure in select statement sql server?

1065


Does index slows down insert statements?

1003


What are .mdf files?

943


What is the meaning of resultset type_scroll_insensitive?

956


what is blocking? : Sql server database administration

1046


Differentiate between a primary key and a unique key.

1073


Write a sql query to display the current date?

1099


Can you please differentiate between a primary key and a unique key?

1010