why the need for is null?

From: Baldur Norddahl <bbn-pgsql(dot)general(at)clansoft(dot)dk>
To: pgsql-general(at)postgresql(dot)org
Subject: why the need for is null?
Date: 2004-01-01 21:45:35
Message-ID: 1072993535.3ff494ff59605@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

How come "X=null" is not the same as "X is null"? I got a few selects with
queries like this:

select * from foo where customer=#customer# or (#customer# is null and customer
is null)

Without the last part, it will not correctly match null customers.

PS. I am using the ibatis framework for java, so the #customer# gets translated
to ? and the whole thing made into a prepared statement.

Thanks,

Baldur

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Cramer 2004-01-01 21:51:11 Re: GetLastInsertID ?
Previous Message Stephane Pinel 2004-01-01 21:40:57 Re: GetLastInsertID ?