This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
kurs:fragen_dezember_2018 [2018/12/16 22:48] admin |
kurs:fragen_dezember_2018 [2018/12/18 13:32] (current) admin |
||
|---|---|---|---|
| Line 33: | Line 33: | ||
| </code> | </code> | ||
| + | <code> | ||
| + | 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" | ||
| + | ) | ||
| + | ) | ||
| + | </code> | ||
| + | | ||
| + | |||
| + | <code> | ||
| + | select department_id, listagg(last_name, ', ') within group (order by job_id desc ) a from employees group by department_id; | ||
| + | </code> | ||
| sql scripts automatisch ausführen | sql scripts automatisch ausführen | ||