SQL-Pivoting in Oracle 11g

Oracle bietet nun die Möglichkeit Pivoting durchzuführen, ohne die DECODE-Funktion zu verwenden.

CONN HR/hr
SET ECHO ON
SET LINESIZE 400
CL SCR
SELECT *
FROM (SELECT DEPARTMENT_ID, SALARY FROM EMPLOYEES)
PIVOT(SUM(SALARY) AS SUM_SALARY FOR (DEPARTMENT_ID) IN (10 AS "10",20 AS "20",30 AS "30"));