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
Explain the dml?
Explain the characteristics of oracle dba?
What is the use of file param in imp command?
What are the types of trigger in oracle?
What is bind variable in oracle 11g?
How to open a cursor variable?
How to update a table row with a record?
Explain enable novalidate constraint.
What are the restrictions on external table columns?
What is a cognitive schema?
What is oracle rowcount?
How to end the current transaction in oracle?
Will you be able to store pictures in the database?explain.
In SAP ECC 6.0 , under DB02 tcode , Tablespace name to be explain stepy step all the col
How to change system global area (sga) in oracle?