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

What part does database design plays a role in performance of an sql server-based application?

961


What is dirty read?

1066


How to execute function in stored procedure sql server?

1118


How to edit table in sql server 2017?

905


which backup strategy you are following at ur company

2132


What is field with example?

904


Can we use max in where clause?

914


What are subqueries in sql server?

1096


What is database white box testing?

1107


What is the difference between clustered and non-clustered indexes in ms sql server?

983


What is lookup override?

1004


What is the difference between delete and truncate statements?

1056


What are the database roles? : sql server security

1145


What are the differences between decimal and float in ms sql server?

1206


What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas

1239