From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | Bhuvan A <bhuvansql(at)yahoo(dot)com> |
Cc: | <pgsql-bugs(at)postgresql(dot)org> |
Subject: | Re: |
Date: | 2002-03-11 16:46:31 |
Message-ID: | Pine.LNX.4.30.0203111138320.690-100000@peter.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Bhuvan A writes:
> > If you compare a NULL with anything you don't get a true value whether
> > you're comparing with =, !=, <, >, etc... That's how it's defined to
> > behave.
>
> where did you get this definition of behaviour!? is it applicable only to
> postgres or ..? its quite strange yaar!
It's how the SQL standard defines it. If other database software claims
to comply to SQL it should also behave that way. (Before you complain
about the SQL standard, its definition was adopted from the common
mathematical notion of three-valued Boolean logic.)
If you want
a <> b
to return true if one of a and b is NULL and the other is not NULL then
you will have to do a bit more work. For example,
(a <> b) or (a is null and b is not null) or (a is not null and b is null)
--
Peter Eisentraut peter_e(at)gmx(dot)net
From | Date | Subject | |
---|---|---|---|
Next Message | Stephan Szabo | 2002-03-11 17:02:09 | Re: |
Previous Message | Yury Bokhoncovich | 2002-03-11 14:33:30 | Re: |