SQL*Plus (MOSC)

MOSC Banner

Is It Possible to Add Missing Years (Quarters) to the Output of My Select

edited Sep 27, 2012 9:07AM in SQL*Plus (MOSC) 8 commentsAnswered ✓
Hi Folks

I wrote a query for a report for my customer and he was asking me to add in the years with '0's if there were no years that had data.

I also have the same request for the report that generates the data by quarters

Does anyone know if that is even possible

Thanks

Jim

##################

Here is my test case:

Test Data:

create table testjc
(
 dataid  number(10),
 name  varchar2(40),
 createdate date
);

insert into testjc values (1,'ITEM-1',sysdate);
insert into testjc values (2,'ITEM-2',sysdate);
insert into testjc values (3,'ITEM-3',to_date ('20110101','yyyymmdd'));
insert into testjc values (4,'ITEM-4',to_date ('20110201','yyyymmdd'));

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center