oracle 根据时间粒度统计记录数
select count(a.Primary_key_column) as receive, b.period
from ((select Primary_key_column from tableName) a
right join
(select level, trunc(sysdate, 'hh') - 1 / 24 * level as period
from dual
connect by level <= 48
order by level) b on trunc(a.Primary_key_column, 'hh') = b.period)
group by period
order by period desc