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

Re: [HACKERS] Group By, NULL values and inconsistent behaviour.

From: Zeugswetter Andreas DBT <Andreas(dot)Zeugswetter(at)telecom(dot)at>
To: "'pgsql-hackers(at)hub(dot)org'" <pgsql-hackers(at)hub(dot)org>
Subject: Re: [HACKERS] Group By, NULL values and inconsistent behaviour.
Date: 1998-01-26 11:51:54
Message-ID: 219F68D65015D011A8E000006F8590C6010A51A8@sdexcsrv1.sd.spardat.at (view raw or flat)
Thread:
Lists: pgsql-hackers
>> In the second query, the first two rows have been grouped, but
shouldn't
>> they not be since b is NULL?  I thought that NULL != NULL?

Note that:
NULL <> NULL		is false
NULL = NULL		is false

> select * from t1 x, t1 y where x.b <> y.b;
          a b  c            a b  c
No rows found.
> select * from t1 x, t1 y where x.b = y.b;
          a b  c            a b  c
No rows found.
> select * from t1 x, t1 y where not x.b = y.b;
          a b  c            a b  c
No rows found.
> select * from t1 x, t1 y where not x.b <> y.b;
          a b  c            a b  c
No rows found.
> select * from t1 where a = b;
          a b  c
No rows found.
> select * from t1 where a <> b;
          a b  c
No rows found.
>

The false seems not to be commutative.
Feel free to ask for more
Andreas
 

pgsql-hackers by date

Next:From: Zeugswetter Andreas DBTDate: 1998-01-26 13:15:58
Subject: Re: [HACKERS] A small type extension example for the contrib directory (fwd)
Previous:From: Zeugswetter Andreas DBTDate: 1998-01-26 11:39:07
Subject: Re: [HACKERS] Group By, NULL values and inconsistent behaviour.

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