Dependendo de como você deseja criá-los, você pode criar uma tabela de calendário ou gere as linhas dinamicamente usando o Oracle
connect by
sintaxe. with the_dates as (
select max(trunc(Create_Dtime)) as max_date
, min(trunc(Create_Dtime)) as min_date
from player
)
, generator as (
select min_date + level as the_date
from the_dates
connect by level <= max_date
)
select g.the_date, count(trunc(p.Create_Dtime))
from generator g
left outer join player p
on g.the_date = trunc(p.Create_Dtime)
group by g.the_date
order by g.the_date desc
Se você descer a opção da tabela de calendário, é um pouco mais limpo:
with the_dates as (
select max(trunc(Create_Dtime)) as max_date
, min(trunc(Create_Dtime)) as min_date
from player
)
select c.the_date, count(trunc(p.Create_Dtime))
from calender c
join the_dates td
on c.the_date between td.min_date and td.max_date
left outer join join player p
on c.the_date = trunc(p.Create_Dtime)
group by c.the_date
order by c.the_date
Ou, tendo acabado de notar suas restrições de data:
with the_dates as (
select to_date('07-05-2012','dd-mm-yyyy') + level as the_date
from dual
connect by level <= trunc(to_date('07-05-2012','dd-mm-yyyy') - sysdate)
)
select td.the_date, count(trunc(p.create_dtime))
from the_dates td
left outer join player p
on td.the_date = trunc(p.create_dtime)
group by td.the_date
order by td.the_date
Para tudo isso, recomendo um índice em
trunc(create_dtime)
no seu player
tabela.