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 / ankit nanda

select [Salary],ID from (select [Salary], ROW_NUMBER() over
(order by Employee.SALARY desc)RowNum from [Employee])e
where e.RowNum=2

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different types of raid levels?

1076


Explain the stored procedure?

994


Explain the xml support sql server extends?

985


Who is the owner of a schema in ms sql server?

1011


What are the restrictions applicable while creating views? : SQL Server Architecture

983


What is the difference between Normalization and De-normalization?

1031


How can I create a report based on a query? : sql server management studio

976


What is precedence constraint?

929


Can select statements be used on views in ms sql server?

1004


How you can add messages to the nt event log from within a stored procedure?

998


How many triggers are possible per table?

1040


What are the advantages of using stored procedures?

893


Tell me about builtinadministrator?

953


What is the difference between sql server 2000 object owner and sql server 2005 schema? : sql server database administration

943


What are the main sources of data?

1040