从EMPLOYEE表,我想记录组(雇员雇用)量,还可以每天运行总计。 输入的格式是这样的:
rownum Hired_date_time 1 1/10/2012 11:00 2 1/10/2012 13:00 3 20/11/2012 10:00 4 20/11/2012 15:00 5 20/11/2012 16:00 6 30/12/2012 1:00
所需的输出:
Hired_date.......Hired_per_day.........TOTAL_number_of_employees 1/10/2012 ...................2 ........2 20/11/2012 ..................3 ........5 30/12/2012 ..................1 ....... 6
用于分组的每天没问题:
select trunc(Hired_date_time) as "Hired_date" ,
count(*) as "Hired_per_day"
from employee
group by trunc(Hired_date_time)
order by trunc(Hired_date_time);
问 :如何才能使用窗口函数我有一个运行总和(在最后一栏)