Answer Posted / venkateswara thiruvedhula
SELECT empno,
deptno,
sal,
RANK() OVER (PARTITION BY deptno ORDER BY sal
desc) "rank"
FROM emp;
EMPNO DEPTNO SAL rank
---------- ---------- ---------- ----------
7934 10 5000 1
7782 10 3000 2
7839 10 2000 3
7369 20 2950 1
7876 20 1700 2
7566 20 1100 3
7788 20 900 4
7902 20 900 4
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is latest version of sql?
What is orm in sql?
What is multiple columns?
Can you rollback after commit?
What is varchar data type in sql?
Which sql most popular?
What is sql*plus?
What is the use of prepared statement?
Can a table have no primary key?
What is view explain with example?
What is procedure and function in sql?
How do you define a foreign key?
Why we use pl sql?
How can I speed up sql query?
Explain the advantages and disadvantages of stored procedure?