Re: NULLs ;-)

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Scott Ribe <scott_ribe(at)killerbytes(dot)com>, pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: NULLs ;-)
Date: 2006-11-28 01:02:45
Message-ID: 20061128010245.40473.qmail@web31809.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


--- Scott Ribe <scott_ribe(at)killerbytes(dot)com> wrote:

> > (Can we talk about NULL next? :P)
>
> Seriously though, there is one thing I've been meaning to bring up. I
> understand why NULLs compare the way they do in queries, and that's fine.
> But there are times when I need to query what would be described in
> relational terms as "not known to be equal", and
>
> where a <> b or (a is null and b is not null) or (a is not null and b is
> null)
>
> is rather clumsy and verbose (though precise), especially when it needs to
> be combined with other criteria.
>
> So, first, have I missed some way to express that more easily in PG? And if
> not, is there any reason not to request a new operator? (Perhaps "a nktbe
> b"? The C guy in me prefers "a != b" but that would be *FAR* too prone to
> confusion with <>.)

how about

SELECT *
FROM
YOURTABLE
where
( a = b ) IN UNKNOWN;

In response to

  • NULLs ;-) at 2006-11-28 00:37:53 from Scott Ribe

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2006-11-28 01:05:32 Re: NULLs ;-)
Previous Message Scott Ribe 2006-11-28 01:01:28 Re: NULLs ;-)