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

How to set the current database in ms sql server?

1084


What is sql language?

1146


What is the maximum size per database for sql server express?

1052


Can we call future method from queueable?

1052


Explain the use of keyword with encryption. Create a store procedure with encryption?

961


What are the options which must be set to allow the usage of optimistic models?

963


Give an example of why you would want to denormalize a database

977


Explain various data region available in ssrs with their use?

934


If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?

967


If you are given access to a SQL Server, how do you find if the SQL Instance is a named instance or a default instance?

1109


How many types of keys are there?

1031


Describe triggers features and limitations?

990


Explain the cursor lock types?

1058


How to drop an existing schema in ms sql server?

1103


What is normalization? What number of normalization shapes are there?

1109