Re: LIKE '%%' does not return NULL - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: LIKE '%%' does not return NULL
Date
Msg-id 20040815115410.B86649@megazone.bigpanda.com
Whole thread Raw
In response to LIKE '%%' does not return NULL  ("Traci Sumpter" <Traci.Sumpter@opus.co.nz>)
List pgsql-sql
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.



pgsql-sql by date:

Previous
From: "Thomas Wegner"
Date:
Subject: tablefunc's in 8.0 Beta Win32 - where?
Next
From: Frank Finner
Date:
Subject: Re: LIKE '%%' does not return NULL