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 sqlca in db2?
What is auto increment in sql?
How can use stored procedures in sql?
What is type and rowtype in pl sql?
Show how functions and procedures are called in a pl/sql block.
What is linq to sql?
what is the difference between join and union? : Sql dba
What is trigger in flip flop?
what are all types of user defined functions? : Sql dba
How can you save or place your msg in a table?
What are the different ways to optimize a sql query?
What is the purpose of design view?
what are the different type of normalization? : Sql dba
How can I tell if sql is running?
What mean sql?