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...

how to check the 3rd max salary from an employee table?

Answer Posted / rutujagabhane

SELECT *
FROM(
SELECT SALARY, DEPARTMENT_ID,EMPLOYEE_ID, DENSE_RANK() OVER (PARTITION BY DEPARTMENT_ID ORDER BY SALARY DESC) AS RN
FROM EMPLOYEES
)
WHERE RN = 2
;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are aggregate and scalar functions? : Sql dba

1122


what is collation? : Sql dba

1224


How do I remove duplicates in two columns?

1177


Can delete statement be rollbacked?

1050


how many tables will create when we create table, what are they? : Sql dba

1140


Do we need to rebuild index after truncate?

1128


What is the best sql course?

1043


what is sql server agent? : Sql dba

1175


Does group by remove duplicates?

1109


Is primary key clustered index?

1013


what is bcp? When does it used? : Sql dba

1053


Is primary key always clustered index?

1090


Is inner join faster than left join?

1273


Can we use distinct and group by together?

1130


what are the advantages of sql ? : Sql dba

1136