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
How to grant create session privilege to a user in oracle?
What are the types of trigger in oracle?
How can we force the database to use the user specified rollback segment?
What is the difference between view and materialized view in Oracle?
What is the difference between hot backup and cold backup in oracle? Tell about their benefits also.
15. Display the item_cost and then truncate it to the nearest hundred, ten, unit, tenth and hundredth.
How to export data to a csv file?
What exactly do quotation marks around the table name do?
How to use group functions in the select clause using oracle?
How to see free space of each tablespace?
How to create a stored function in oracle?
what is IDE,DMV in sql server?
What are data pump export and import modes?
What is the difference between post-database commit and post-form commit?
Can we connect to ORACLE db using Windows Authentication?