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 ddl triggers and types of ddl trigger?

1093


Find columns used in stored procedure?

1038


What are the new features in SQL Server 2005 when compared to SQL Server 2000?

1212


How to find Duplicate Records In table?

1071


What is clr ddl trigger?

1034


Do you know nested transaction?

1001


What is a non equi join?

1022


When setting replication, is it possible to have a publisher as 64 bit sql server and distributor or subscribers as a 32 bit sql server?

1000


what protocol both networks use? : Sql server database administration

1017


How does recursive cte works in sql server?

1059


What do you mean by data integrity?

1127


How to create a local temporary stored procedure?

1047


What is the use of @@spid?

1048


What is a group function explain with an example?

1039


How to convert a table data in XML format in sql server?

2595