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
Can we alter stored procedure?
How do I truncate a sql log file?
write an sql query to get third maximum salary of an employee from a table named employee_table. : Sql dba
How can the performance of a trigger be improved?
What is the difference between unique and primary key constraints?
what is a control file ? : Sql dba
Which is better join or inner query?
Does inner join return duplicate rows?
What is mutating error?
Explain how you can copy a file to file content and file to pl/sql table in advance pl/sql?
Can we call dml statement in function?
What are the constraints available in sql?
What is the difference between sql and t sql?
Why do we use cursors?
What is difference between hql and sql?