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

can an automatic recovery be initiated by a user? : Sql server administration

967


Which tcl commands are available on the sql server?

1095


Does partitioning ssd reduce performance?

899


Explain few examples of RDBMS?

1050


What is tempdb database? : SQL Server Architecture

1209


Explain the difference between control flow and data flow?

1013


Can group functions be mixed with non-group selection fields in ms sql server?

955


Can the query output be sorted by multiple columns in ms sql server?

992


When would you use the stored procedures or functions?

1013


How to provide default values to stored procedure parameters?

1074


What is the default Port No on which SQL Server listens?

1134


Is truncate a dml command?

965


Explain the advantages of merge replication?

961


Why and when do stored procedure recompile?

994


Write an sql query to find first weekday of the month?

929