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

Can we write a distributed query and get some data which is located on other server and oracle database?

1233


When cursors are useful?

1110


How to write the storeprocedure with in the store procedure? and how can we write the store procedure with in a trigger vice versa? plz post me the exact answer?

2588


Why you need indexing? Where that is stored and what you mean by schema object? For what purpose we are using view?

910


Explain the etl (extraction, transformation, and loading)?

998


Write an SQL query to obtain the 2nd highest salary.

1079


Explain the different index configurations a table can have?

948


Can you edit the .rdl code associated with a linked report?

163


What are the steps you can take to avoid “deadlocks”?

978


Explain datetimeoffset data type in sal server 2008?

915


How do I schedule a sql server profiler trace?

983


How to generate create view script on an existing view?

989


Can I run multiple instances of sql server 2000 at the same time on one computer?

1074


Why Master database is required?

1148


What is the difference between varchar and nvarchar datatypes?

1091