Professional Documents
Culture Documents
Ex:
SQL> select
empno,ename,sal,deptno,decode(deptno,10,'ACCOUNTING',20,'RESEARCH',30,'SALES','OTHE
RS') Dname from emp;
Case Expression:
Simple Case:
Searched case:
SQL> select * from (select emp.*,dense_rank() over (order by sal desc) R from emp)
where r= &n;
In case of rank it will give same rank to any duplicate value but the value comes
after that will not start with next rank.
In case of dense_rank it will give same rank to any duplicate value but the value
comes after that will start with next rank.
SQL> select * from emp where deptno=20/*only display dept 20 detail..*/; (In this
way we can comment part of a line)
SQL> select * from emp where deptno=20
2 --display dept 20 details..; (In this way we can comment whole line)
3) Rename a column:
4) Remove a column:
5) Rename a table:
6) Remove a table: