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

SELECT ID, SALARY FROM
(
SELECT ID, SALARY, ROW_NUMBER() OVER (ORDER BY SALARY) AS RN
FROM EMPLOYEE
)
WHERE RN = 1

(YOU CAN CHANGE VALUE OF RN = ANY NUMBER AND YOU WILL GET
THAT VALUE)

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an etl file?

940


What functions can a view be used to performed?

1049


‘Order by’ is not allowed in a view how can you sort information from a view?

1068


How do I find the size of a sql server database?

906


What is a collation in ms sql server?

1056


What is the difference between the 2 operating modes of database mirroring?

1090


Explain about analysis services?

1032


How many cores do I need for sql server 2016?

873


What do you mean by sql server agent?

973


What is acid mean in sql server?

1093


What are the differences between substr and charindex in sql server.

1081


what is the system function to get current user's user id? : Sql server database administration

979


How to select true false based on column value in sql server?

995


How to list all schemas in a database?

1041


Explain what are the basic functions for master, msdb, model, tempdb databases?

950