sql >> Base de Datos >  >> RDS >> Oracle

ORACLE SQL Ejecutando TOTAL y daytotal usando la función de ventana

select trunc(hired), 
       count(*) hired_today,       
       sum(count(*)) over (order by trunc(hired)) as running_total
from emp
group by trunc(hired)

http://sqlfiddle.com/#!4/4bd36/9