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 does := mean in pl sql?
How global cursor can be declare with dynamic trigger ?
What are the advantages of pl sql?
What is a dirty read sql?
How many disk partitions should I have?
What is procedure and function in sql?
How does rowid help in running a query faster?
Which are the different character-manipulation functions in sql?
What is a procedure in pl sql?
a table has 2 classifications 1)liabilities 2)earnings this liabitity has 2 elements with 2 input values and the earnings have 2 elements with 2 input values i wrote a query so that my input is liability savings amount1 amount2 xxxx null xxxxxx 0 xxx1 null xxxxx1 0 null yyyy 0 yyyy null yyy1 0 yyy1 my problem is --when i developed a report(d2k) with this data my o/p is liabilities,amount1,savings,amount2 xxxx xxxxxx xxx1 xxxxx1 yyyy yyyy yyy1 yyy1 how could i move this savings,savings values 2 palces up. can any body provide me witha better solution
What is coalesce in sql?
describe mysql connection using mysql binary. : Sql dba
Can ddl statements be used in pl/sql?
How to revise and re-run the last sql command?
What are the types of functions in sql?