Re: Some more weird NULL behavior - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: Some more weird NULL behavior
Date
Msg-id 20021108210410.F19592-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Some more weird NULL behavior  (Ludwig Lim <lud_nowhere_man@yahoo.com>)
List pgsql-sql
On Fri, 8 Nov 2002, Ludwig Lim wrote:

> Hi:
>
>   I tried the following:
>   CREATE TABLE x(
>        a  NUMERIC(5,0),
>        b  VARCHAR(5)
>   );
>
>   CREATE TABLE y(
>        a  INTEGER,
>        b  VARCHAR(5)
>   );
>
>   INSERT INTO x(b) VALUES ('LUDZ');
>   INSERT INTO y(b) VALUES ('TEST');
>
>   SELECT x.b,y.b FROM x,y WHERE x.a=y.a
>   returns zero rows.

A comparison of two NULL values does not
return true, it returns unknown.
If you want to say equal or both null you
should do it explitly.
(x.a=y.a) or (x.a is null and y.a is null)




pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: More than 1 trigger of the same kind
Next
From: Bruno Wolff III
Date:
Subject: Re: Time difference without intervals