This shows you the differences between two versions of the page.
| — |
kurs:pivot [2022/03/14 14:24] (current) admin created |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | <code> | ||
| + | with cte_quartal as ( | ||
| + | select | ||
| + | employee_id, | ||
| + | employee_id emp_id, | ||
| + | last_name, | ||
| + | to_char(hire_date, 'Q') quartal | ||
| + | from hr.employees | ||
| + | ) | ||
| + | select * from cte_quartal | ||
| + | pivot | ||
| + | ( | ||
| + | count(employee_id) for quartal in ( | ||
| + | '1' q1, | ||
| + | '2' q2, | ||
| + | '3' q3, | ||
| + | '4' q4) | ||
| + | ) | ||
| + | |||
| + | </code> | ||