This shows you the differences between two versions of the page.
— |
kurs:group_by_year [2014/09/10 21:22] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <code> | ||
+ | select years2, count(years), count(years2), count(years)-count(years2) from ( | ||
+ | -- select extract(year from ((sysdate - hire_date) year to month)) years from employees | ||
+ | select extract(year from ((sysdate - hire_date) year to month)) years, | ||
+ | trunc((sysdate - hire_date)/365) years2 | ||
+ | from employees | ||
+ | ) | ||
+ | group by years2 | ||
+ | order by years2 | ||
+ | </code> |