Databasen - NULL dates

Hakim Cassimally hakim.cassimally at gmail.com
Wed Oct 18 12:04:38 BST 2006


On 18/10/06, Neil de Carteret <n3dst4 at gmail.com> wrote:
> > Anyone think of any other alternatives to using NULL?
>
> I wouldn't advocate it, but a second table, the PK of which FKs the
> first table.  Then you can do a COUNT() to see if there's a date set
> for an entity.  Or a LEFT JOIN, in which case you still get NULLs
> returned but at least you're not storing them in the database.

I read a "NULL is evil!" paper that suggested having exactly such a
table with the dates (if they existed) linked to the main table.  And
then another table containing the ids of records that *didn't* contain
a date.

Er, yeah, I'd just use NULLS :-)

osfameron


More information about the london.pm mailing list