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
How do I create a sql script?
What are its different types of dbms?
What is the difference between row level and statement level trigger?
How can I delete duplicate rows?
how does a local variable is defined using t-sql? : Transact sql
What is pessimistic concurrency control? : Transact sql
what are the advantages a stored procedure? : Sql dba
How do you identify a primary key?
Can unique keys be null?
What is a data manipulation language?
How do I find duplicates in a single column in sql?
what is 'mysqladmin' in mysql? : Sql dba
What is a Mapplet?
What are the various levels of constraints?
Explain the purpose of %type and %rowtype data types?