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

From Traci Sumpter
Subject LIKE '%%' does not return NULL
Date
Msg-id KFEJJKOAGCCGEJFLKCBBKEALEBAA.Traci.Sumpter@opus.co.nz
Whole thread Raw
Responses Re: LIKE '%%' does not return NULL  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: LIKE '%%' does not return NULL  (Frank Finner <postgresql@finner.de>)
List pgsql-sql
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.

Is this the way (SQL) to do this??

Is there a better syntax to the SQL??

Is the better way to create the statement in PHP is to check if the passed
value <> '' ??

Or is this issue being fixed in the new V8 version of postgreSQL.



pgsql-sql by date:

Previous
From: Sascha Ziemann
Date:
Subject: Re: UNIQUE constraint
Next
From: Michalis Kabrianis
Date:
Subject: Re: Sum and count weird results