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

drop table #temp
select top 2 identity(int,1,1) as SlNo, *
into #temp from employee order by salary desc
select * from #temp where SlNo = 2

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you explain the disadvantages/limitation of the cursor?

970


What is ems sql management studio? : sql server management studio

1084


Difference between DELETE and TRUNCATE?

1034


Which is faster statement or preparedstatement?

921


How do I connect to sql server database?

997


What are xml indexes?

925


Explain what are partitioned views and distributed partitioned views?

930


How many clustered indexes there can be on table ?

1011


How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?

1999


How to make a remote connection in a database?

957


How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

1972


What is the Main Difference between ACCESS and SQL SERVER?

1114


What is onf in normalization form?

1036


What is dimension table? : sql server analysis services, ssas

1001


How to Check if table exists in sql server?

1116