I have a table (PROJECT) which maintains yearly expenses information. It has the expenses for an year and also the cumulative expenses till that year .
The table may or may not have data for all the years in a consecutive manner
The PROJECT table data is like
Project_id Year Yr_Exp Cum_Exp
---------------------------------------
ABC 2002 1000 1000
ABC 2005 2000 3000
ABC 2007 7000 10000
But I need a view which gives me data for all the consecutive years whether or not any expenses have been incurred in that year
I need an output like below
Project_id Year Yr_Exp Cum_Exp
---------------------------------------
ABC 2002 1000 1000
ABC 2003 0 1000
ABC 2004 0 1000
ABC 2005 2000 3000
ABC 2006 0 3000
ABC 2007 7000 10000
How can I achieve this . Could someone please suggest me a query for this
The table may or may not have data for all the years in a consecutive manner
The PROJECT table data is like
Project_id Year Yr_Exp Cum_Exp
---------------------------------------
ABC 2002 1000 1000
ABC 2005 2000 3000
ABC 2007 7000 10000
But I need a view which gives me data for all the consecutive years whether or not any expenses have been incurred in that year
I need an output like below
Project_id Year Yr_Exp Cum_Exp
---------------------------------------
ABC 2002 1000 1000
ABC 2003 0 1000
ABC 2004 0 1000
ABC 2005 2000 3000
ABC 2006 0 3000
ABC 2007 7000 10000
How can I achieve this . Could someone please suggest me a query for this