From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Traci Sumpter <Traci.Sumpter@opus.co.nz>
Cc: pgsql-sql@postgresql.org
Subject: Re: LIKE '%%' does not return NULL
Date: Sun, 15 Aug 2004 11:56:07 -0700 (PDT)
Message-ID: <20040815115410.B86649@megazone.bigpanda.com> (raw)
In-Reply-To: <KFEJJKOAGCCGEJFLKCBBKEALEBAA.Traci.Sumpter@opus.co.nz>
References: <KFEJJKOAGCCGEJFLKCBBKEALEBAA.Traci.Sumpter@opus.co.nz>
On Wed, 11 Aug 2004, Traci Sumpter wrote:
> A team developer has chosen the lazy way of not checking if a variable
> exists on his PHP page and has code which produces the following SQL
>
> SELECT * FROM mytable where myfield ilike '%%'
>
> I have noticed that this statement does not return null or empty myfield
> records.
It should not return true for NULLs but should for empty fields (which it
does AFAICS).
If you want to get the NULLs as well you'll need to explicitly OR myfield
is NULL.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sszabo@megazone.bigpanda.com, Traci.Sumpter@opus.co.nz
Subject: Re: LIKE '%%' does not return NULL
In-Reply-To: <20040815115410.B86649@megazone.bigpanda.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox