Re: Impossible Database Design?
From: -CELKO- <jcelko212_at_earthlink.net>
Date: 17 May 2006 04:58:41 -0700
Message-ID: <1147867121.083442.143010_at_j73g2000cwa.googlegroups.com>
Date: 17 May 2006 04:58:41 -0700
Message-ID: <1147867121.083442.143010_at_j73g2000cwa.googlegroups.com>
You can use a NULL end_date for an "eternity marker" then "COALESCE (end_date, CURRENT_DATE)" is a VIEW or queries for the current state of affairs. For longer term, use something like "COALESCE (end_date, (SELECT MAX(end_date FROM Calendar))".
You do not have to generate all the dates (which can only go to 9999-12-31 in ISO Standards), but just a subset of them as needed. The days-of-the week cycle is every 19 years (i Think) so you can use that fact to set your window. Received on Wed May 17 2006 - 13:58:41 CEST