Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: newbie: A Quickie for some guru out there.
Make a dummy table containing just a record for each montth with requesthours set to 0
create table dummytable
(workdate date,
requesthours number);
insert into dummytable
values (to_date('01-2001','MM-YYYY');
insert into dummytable
values (to_date('02-2001','MM-YYYY');
insert into dummytable
values (to_date('03-2001','MM-YYYY');
insert into dummytable
...
values (to_date('11-2001','MM-YYYY');
insert into dummytable
values (to_date('12-2001','MM-YYYY');
and so on, then change your query
> SELECT
> TO_CHAR( trunc( workdate, 'month' ), 'MON-YYYY' ) AS Month,
> ROUND( SUM( requesthours ))
> FROM
(select * from cst_request_table union all select * from dummytable)
this would works.
btw: you can do the same even with a function instead of dummytable. if you are interested tell me Received on Mon Sep 16 2002 - 03:20:08 CDT