This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
kurs:group_by_beispiele [2014/05/20 15:24] mh |
kurs:group_by_beispiele [2020/05/18 11:25] (current) admin |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | <code> | ||
| + | select | ||
| + | department_name, | ||
| + | count(*) c | ||
| + | from employees e join departments d | ||
| + | on e.department_id = d.department_id | ||
| + | group by | ||
| + | department_name | ||
| + | having count(*) >= 5 | ||
| + | order by c desc | ||
| + | </code> | ||
| + | |||
| + | |||
| <code> | <code> | ||
| with ym as ( | with ym as ( | ||