Re: select * from mytable where myfield=null;

From: "Marin Dimitrov" <marin(dot)dimitrov(at)sirma(dot)bg>
To: <hoanui(at)excite(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: select * from mytable where myfield=null;
Date: 2002-05-14 13:54:21
Message-ID: 00b701c1fb4e$d9532410$9ba1d53e@sirma.bg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


----- Original Message -----
From: "Hoanui Morangie"

>
> I need NULL value, some of these columns are foreign keys.

introduce dummy tupples too, f.e. if u consider 0 as the NULL for numbers,
then have a dummy row with ID=0, so that the FK won't be violated and u'll
still have NULL semantics

>And using dummy values is not good practice anyway.
>

indeed, 3-valued logic (nulls) is often considered as a flaw and NULL usage
is not recommended.
And in your case u won't make use of any indexes for the queries, because
these null values can't be indexed

Marin

----
"...what you brought from your past, is of no use in your present. When
you must choose a new path, do not bring old experiences with you.
Those who strike out afresh, but who attempt to retain a little of the
old life, end up torn apart by their own memories. "

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Hoanui Morangie 2002-05-14 14:03:47 Re: enquiring
Previous Message Hoanui Morangie 2002-05-14 13:51:48 Re: select * from mytable where myfield=null;