I have this query:
Select Trunc(Create_Dtime),Count(Trunc(Create_Dtime)) as Day_0 From Player
Group By Trunc(Create_Dtime)
Order By Trunc(Create_Dtime) Asc
It gives me back dates but if a date doesn’t have any results, that is skipped. I’d like to fill in all dates from 8-05-12 to present, and if those days don’t have any values, just have a 0 in the results.
Depending on how you want to create them you can either create a calender table or generate the rows dynamically using the Oracle
connect bysyntax.If you go down the calender table option it’s a little bit cleaner:
Or, having just noticed your date constraints:
For all of these I’d recommend an index on
trunc(create_dtime)on yourplayertable.