Re: model inherited object

From: -CELKO- <jcelko212_at_earthlink.net>
Date: 22 Jun 2006 13:28:40 -0700
Message-ID: <1151008120.250153.15710_at_r2g2000cwb.googlegroups.com>


>> but can there be more than one null end date for a particular location? <<

For a location, yes. For temporal fact, no. Assume today is New Years Day:

  1. "John waited at bus stop #42 from "2006-01-01 12:00" until "2006-01-01 12:05" to catch the Snerdville limited"
  2. "Joe waited at bus stop #42 from "2006-01-01 12:00" until NULL to catch the Mugville limited"

Same locations, different temporal facts

>> in what-if modelling my 2007 change does not complete my 2005 location. <<

So?
>> I want a view of a location at a certain date, won't I have to do a massively complex select, maybe trying to analyze many "history" rows of the same location to see the correct values for all attributes? <<

Very easy. Create a Calendar table and use:

 WHERE C.cal_date BETWEEN Events.start_date

                              AND COALESCE (Events.end_date,
C.cal_date)
or:
 WHERE C.cal_date BETWEEN Events.start_date
                              AND COALESCE (Events.end_date,
CURRENT_TIMESTAMP) The auxiliary Calendar table is very handy for other things, too. Received on Thu Jun 22 2006 - 22:28:40 CEST

Original text of this message