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 DISPLAY MAXIMUM SALARIES FROM EMP DEPARTMENT VISE ALONG
WITH DEPARTMENT NAMES? E.g EMP,DEPT

Answer Posted / selvaraj v

In oracle 10g :

SELECT * FROM
(SELECT DEPTNO,
EMPNO,
ENAME,
SAL,
DENSE_RANK() OVER(PARTITION BY DEPTNO ORDER BY SAL
DESC) RANK
FROM EMP);

OUTPUT :
------------>

DEPTNO EMPNO ENAME SAL RANK
---------- ---------- ---------- ---------- ----------
10 7839 KING 5000 1
10 7782 CLARK 2450 2
10 7934 MILLER 1300 3
20 7788 SCOTT 3000 1
20 7902 FORD 3000 1
20 7566 JONES 2975 2
20 7876 ADAMS 1100 3
20 7369 SMITH 800 4
30 7698 BLAKE 2850 1
30 7499 ALLEN 1600 2
30 7844 TURNER 1500 3

DEPTNO EMPNO ENAME SAL RANK
---------- ---------- ---------- ---------- ----------
30 7521 WARD 1250 4
30 7521 WARD 1250 4
30 7654 MARTIN 1250 4
30 7900 JAMES 950 5

15 rows selected.

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use null as conditions in oracle?

1003


How many types of table in Oracle?

1063


What are the attributes of the cursor?

937


How to execute the package in oracle?

1039


How to convert characters to numbers in oracle?

1001


How can I introduce multiple conditions in like operator?

926


What is translate in oracle?

1051


How can you merge two tables in oracle?

939


Using the relations and the rules set out in the notes under each relation, write statements to create the two sequence generators specified in the notes.

2047


What are triggers in oracle?

978


How do I manually create a database in oracle?

957


21. Using a set operator, display the client number of all clients who have ever placed an order and whose whose name does not contain the string Sm.

2046


What do you understand by database schema and what does it hold?

1180


How to rename an index in oracle?

1063


What happens if the update subquery returns multiple rows?

1046