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

SELECT sm ,custid ,ordyear,amount FROM
(SELECT sm ,custid ,ordyear,amount,Rank() OVER (ORDER BY
amount desc)as Rank
FROM dbo.OrderCust)p where rank=2


This is used to select all the rows having the second max
salary.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?

924


Explain different forms of normalization?

923


Is sql server is free?

951


Explain the concepts and capabilities of sql server?

952


How many types of attribute relationships are there? : sql server analysis services, ssas

1051


What are the difficulties faced in cube development? : sql server analysis services, ssas

1018


Explain the difference between functions and stored procedures in sql server?

960


What is sub-query in sql server?

1185


What happens if ntwdblib.dll is missing on your machine?

1127


Explain different types of locks in sql server.

1064


What are the restraints imposed on the table design by a merge replication?

1020


How to modify an existing stored procedure in ms sql server?

1054


What are the types of database schema? : sql server analysis services, ssas

1107


How to transfer data from a cursor to variables with a "fetch" statement?

1070


What are the advantages of sql azure?

140