dbTalk Databases Forums  

problem w/ creating view to show previous year's data...

comp.databases.oracle comp.databases.oracle


Discuss problem w/ creating view to show previous year's data... in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
MT
 
Posts: n/a

Default problem w/ creating view to show previous year's data... - 08-10-2004 , 07:20 PM






hi all,
I have a view that has data from this year as well as previous years.
the select statment looks something like this:

create view as select
year,
costs_mon1,
costs_mon2,
costs_mon3
costs_mon4,
....
....
costs_mon12,
costs_current_month
from table x

the problem is I also need a current month field in this view (the
view is more complicated than the above example--we're pulling fields
from multiple tables as well as a UNION to grab a couple other
fields).

I have a PL/SQL script that loads data and I use a variable for
current_month so when the view is created, the current month costs are
put in correctly--but only for the current year. I need to have the
"current_month" for previous years to always equal month 12. My UI
shows data for previous years, but the data needs to be displayed as
if it was the last day of that year.

I'm kind of stuck on how to go about this. do I do something in the
script or can I manipulate the view to populate the
costs_current_month to always equal the costs from month 12 in
previous years.
any ideas would be greatly appreciated.
thanks

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.