This shows you the differences between two versions of the page.
kurs:case_group_by [2014/09/10 21:22] |
kurs:case_group_by [2014/09/10 21:22] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <code> | ||
+ | select alt, count(alt) from ( | ||
+ | select ((case when hire_date > (sysdate - to_yminterval('12-0')) then 'Neuling' | ||
+ | when hire_date > (sysdate - to_yminterval('15-0')) then 'Mittelding' | ||
+ | else 'Alter Sack' end)) alt | ||
+ | from employees) | ||
+ | group by alt | ||
+ | </code> |