Beruflich Dokumente
Kultur Dokumente
Read Only Tables: In Oracle 11g, a table can be set READ ONLY mode to restrict
write operations on the table. A table can be altered to toggle over READ ONLY and
READ WRITE modes.
create table ptest
(id number(5),name varchar2(20),age number(3));
commit;
commit;
Pivot and Unpivot: The PIVOT operator takes data in separate rows, aggregates it
and converts it into columns. The UNPIVOT operator converts column-based data into
separate rows.
(Note: UNPIVOT is not the reverse of a PIVOT operation as it cannot undo
aggregations made by PIVOT.)
PIVOT:
SELECT *
FROM (SELECT job, deptno, sum(sal) sal FROM emp GROUP BY job, deptno)
PIVOT ( sum(sal) FOR deptno IN (10, 20, 30, 40) );
Listagg function in 11g release 2: LISTAGG is a built-in function that enables us
to perform string aggregation natively.
The LISTAGG function has the following syntax structure:
LISTAGG ([,]) WITHIN GROUP (ORDER BY) [OVER (PARTITION BY)]