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 need department wise top 2 employees salary.which logic
i will use

Answer Posted / ashok kumar y

SELECT a.deptno, a.sal
FROM (SELECT deptno, sal,
DENSE_RANK () OVER (PARTITION BY deptno ORDER BY sal DESC NULLS LAST) max_sal
FROM emp
WHERE deptno IS NOT NULL) a
WHERE max_sal <= 2 group by deptno,sal ;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I remove sql plus from windows 10?

1107


What is trigger explain with example?

1045


What is cursor in pl sql with examples?

1037


Why is normalization important?

1033


How can I change database name in sql?

1089


What are all the different normalization?

1045


How do I view a sql database?

1023


Is coalesce faster than isnull?

970


What programs use sql?

1017


what are the advantages of sql ? : Sql dba

1064


What is left join in sql?

1056


what are the different index configurations a table can have? : Sql dba

1000


Explain how to use transactions efficiently : transact sql

987


What is right join sql?

969


What is mutating error in pl sql?

1029