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...

I Have Employee table having column name as ID,SALARY
how to get second max salary from employee table with id
ex
ID SALARY
1 20000
7 37000
2 5000

Answer Posted / radhakrishnan vaithilingam

SELECT TOP 1 id.salary
FROM (SELECT TOP 2 id,salary
FROM employee
ORDER BY salary DESC )a
ORDER BY a.salary ASC

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about protocol layer present in SQL server?

1292


Where are stored procedures in sql server?

1125


What is difference between views and stored procedures?

1029


What is it unwise to create wide clustered index keys?

1045


What's the information that can be stored inside a bit column?

1069


What is for xml in sql server?

1138


What are the tool windows in sql server management studio? : sql server management studio

1122


Is truncate a dml command?

999


What is the difference between executequery () and executeupdate ()?

1110


What is statement level trigger?

1046


How do I clean up sql server transaction log?

1124


How to create an index on an existing table in ms sql server?

1027


What are sql server procedures?

1036


How do I uninstall sql server 2014?

985


What is the difference between dropping a database and taking a database offline?

1218