Some more weird NULL behavior

From: Ludwig Lim <lud_nowhere_man(at)yahoo(dot)com>
To: PostgreSQL Mailing List <pgsql-sql(at)postgresql(dot)org>
Subject: Some more weird NULL behavior
Date: 2002-11-09 04:30:13
Message-ID: 20021109043013.3645.qmail@web80307.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-11-09 04:33:31 Re: More than 1 trigger of the same kind
Previous Message Stephan Szabo 2002-11-09 03:49:52 Re: More than 1 trigger of the same kind