Skip site navigation (1) Skip section navigation (2)

Re: Can't join on null values

From: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
To: David Newall <davidn-postgres(at)rebel(dot)net(dot)au>
Cc: PostgreSQL bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Can't join on null values
Date: 2004-07-07 19:38:39
Message-ID: Pine.LNX.4.44.0407072137470.10835-100000@kix.fsv.cvut.cz (view raw or flat)
Thread:
Lists: pgsql-bugs
Hello,

its not error. Only SQL specific :-) NULL <> NULL

Regards
Pavel Stehule

On Tue, 6 Jul 2004, David Newall wrote:

> PostgreSQL version:  7.4.3 (RPMs from ftp.au.postgresql.org)
> 
> Operating Sysem: Fedora Core 1
> 
> CREATE TABLE t1 (i INTEGER, j INTEGER);
> INSERT INTO t1 VALUES (1, NULL);
> CREATE TABLE t2 AS SELECT * FROM t1;
> SELECT * FROM t1 JOIN t2 USING (i, j);
>  i | j
> ---+---
> (0 rows)
> 
> I believe the one row, which is identically present in both table,
> should be selected.  The problem occurs because of the NULL value.
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>       message can get through to the mailing list cleanly
> 


In response to

Responses

pgsql-bugs by date

Next:From: Stephan SzaboDate: 2004-07-07 19:38:45
Subject: Re: UNIQUE not honoured for NULL
Previous:From: James AntillDate: 2004-07-07 19:29:58
Subject: Re: finding a max value

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group