pivot dynamisch
WITH
T
AS
(
SELECT
department_id,
JOB_id,
salary
FROM
employees
where job_id in (
'ST_CLERK', 'SH_CLERK'
)
)
SELECT
*
FROM
T
PIVOT
(
MIN(SALary) AS MINSAL,
MAX(SALary) AS MAXSAL
FOR
(JOB_ID)
in
( 'ST_CLERK', 'SH_CLERK')
)
ORDER BY
department_id
select * from (select employee_id,
job_id,
to_char(hire_date, 'YYYYQ') quartal
from employees
)
pivot (count(employee_id)
for quartal in ('20071' "2007 Q1",
'20072' "2007 Q2",
'20073' "2007 Q3",
'20074' "2007 Q4"
)
)
select department_id, listagg(last_name, ', ') within group (order by job_id desc ) a from employees group by department_id;
sql scripts automatisch ausführen
zeitliche Nachverfolgung von Änderungen
zustand der session