Re: view puzzle

From: Ed prochak <ed.prochak_at_magicinterface.com>
Date: 16 Jan 2004 11:30:56 -0800
Message-ID: <4b5394b2.0401161130.2248fbe5_at_posting.google.com>


puppet_sock_at_hotmail.com wrote in message news:<c7976c46.0401160757.5ac25579_at_posting.google.com>...
> Here's what I want to do.
>
> I want a view that restricts to rows that are "in date" when a
> working date exists, but shows the whole table when no date exists.
>
> I have a temporary global work-items table that has a single row
> including the working date as one column. This is scrubbed when
> the connetion to the database is closed. But some automated
> processes will connect and not put an entry into the work items
> table. There will be zero rows in the table.
>
> Is there a not-too-complicated way to construct a view that
> restricts by a date when there is one, but does not restrict
> when there is no date?
>
> Restricting to the date is pretty simple when it's there. It's
> just a select statement that has start_date <= working_date
> and end_date >= working_date. But how do I procede when there
> is no working date?
> Socks

offhand, I cannot think of how the final version will work, but AFAIK if "there is no working date", then your WHERE clause will test for NULL, IOW,
WHERE working_date IS NULL

Hmm, will the final complete SQL view contain a NOT IN clause??

HTH
ed Received on Fri Jan 16 2004 - 20:30:56 CET

Original text of this message