Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

ORACLE SQL Executando TOTAL e daytotal usando a função de janela

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