Shane Ambler wrote:
Lutz Steinborn wrote:
Jepp, thats it.
I've supposed this but can't believe it. So NULL is something out of this
dimension :-)



NULL refers to an unknown value - it cannot be said to equal or not equal anything other than NULL ...

Not exactly. Null does not equal null. The "translation" being does some-unknown-value equal some-unknown-value? Answer: unknown.
If you want to determine if something is null you must use "is null".

select null = null;
null

select null is null;
true

If you want to treat nulls as a defined known value, use the coalesce function:
select coalesce(my_column, 'a null value')....;
will return the string 'a null value' whenever my_column is null.

Cheers,
Steve


--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to