Re: LIKE '%%' does not return NULL

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: LIKE '%%' does not return NULL
Дата
Msg-id 20040815115410.B86649@megazone.bigpanda.com
обсуждение исходный текст
Ответ на LIKE '%%' does not return NULL  ("Traci Sumpter" <Traci.Sumpter@opus.co.nz>)
Список 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 по дате отправления:

Предыдущее
От: "Thomas Wegner"
Дата:
Сообщение: tablefunc's in 8.0 Beta Win32 - where?
Следующее
От: Frank Finner
Дата:
Сообщение: Re: LIKE '%%' does not return NULL