Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Using SELECT to fill in missing entries?
laredotornado_at_gmail.com (D. Alvarado) wrote in
news:ec027e73.0409040824.78cfbbda_at_posting.google.com:
> Hello, I am running Oracle 8.1.7 on Solaris 8. I have a table that
> records the number of registrants per day. Here is an example of some
> data.
>
> DAY NUM_REGISTRANTS
> --- ---------------
> 2004-07-01 2
> 2004-07-04 5
> 2004-07-06 3
>
> When a day is not present, it means there were 0 registrants on that
> day. Does anyone know, given a beginning and ending date, how to form
> a SELECT statement such that I can select entries for days even if no
> entries are in the table? That is, given the dates 2004-07-01 and
> 2004-07-06, how would I form a SELECT statement that would produce the
> output ...
>
> DAY NUM_REGISTRANTS
> --- ---------------
> 2004-07-01 2
> 2004-07-02 0
> 2004-07-03 0
> 2004-07-04 5
> 2004-07-05 0
> 2004-07-06 3
>
> ? Thanks for your help, - Dave
>
One possible alternative is to modify the appication that inserts new rows to always start with a record with a count of 0. Received on Sat Sep 04 2004 - 17:39:02 CDT
![]() |
![]() |