From: Ludwig Lim <lud_nowhere_man@yahoo.com>
To: PostgreSQL Mailing List <pgsql-sql@postgresql.org>
Subject: Some more weird NULL behavior
Date: Fri, 8 Nov 2002 20:30:13 -0800 (PST)
Message-ID: <20021109043013.3645.qmail@web80307.mail.yahoo.com> (raw)
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.
However:
SELECT b FROM x WHERE a IS NULL returns 'LUDZ'
SELECT b from y WHERE a IS NULL returns 'TEST'
I also tried
SELECT x.b,y.b
FROM x,y
WHERE x.a = CAST(y.a AS INTEGER);
But it also returns zero rows.
Thank you in advance,
ludwig.
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: lud_nowhere_man@yahoo.com
Subject: Re: Some more weird NULL behavior
In-Reply-To: <20021109043013.3645.qmail@web80307.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox