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

select top 1 id,salary from(select top 2 id,salary from
employee group by id,salary order by salary desc)a order by
salary asc

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Data table as parameter in sql server?

1102


What is a cache in ssrs?

138


What is Federation and Federation Member?

94


What is exporting and importing utility?

1139


what is a join and explain different types of joins? : Sql server database administration

1001


Detail about the hardware which is supported by SQL server?

1116


Difference between uniqe index and uniqe constraint?

1043


What are views used for?

1058


What do you understand by triggers and mention the different types of it?

997


Explain few examples of stored procedure over triggers?

1113


What is measure group, measure? : sql server analysis services, ssas

1070


What is the difference between having clause and where clause in sql server?

1163


Which tcp/ip port does the sql server run on? How can it be changed?

1105


What are dml (data manipulation language) statements in ms sql server?

1022


What are the different types of normalization?

1219