User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
kurs:employees_per_year [2014/09/10 21:22] external edit
kurs:employees_per_year [2016/12/01 13:53] (current)
Line 20: Line 20:
 <​code>​ <​code>​
-with list_years ​as ( +with list_year ​as ( 
-select level-1 + 1985 as ya from dual connect by level<20+select level-1 +  
 +(select extract(year from min(hire_date)) from emp) 
 +as yl from dual connect by level <=  
 +(select extract(year from max(hire_date)) - 
 +        extract(year from min(hire_date)) + 1 
 +from emp) 
 ) )
-select ​ya, count(hire_date) from employees ​right join list_years +select ​yl, count(employee_id) from emp right join 
-on ya (extract(year from hire_date)+  ​list_year ​on yl = extract(year from hire_date) 
-group by ya +  group by yl 
-order by ya+  order by yl
 </​code>​ </​code>​
kurs/employees_per_year.txt · Last modified: 2016/12/01 13:53 by admin