Subject Re: [firebird-support] Null and LIKE Clause
Author Christianto Tjahyadi
Hi Martijn,

When we use LIKE '%', adding OR COLUMN2 IS NULL will solve the problem. But
when we use LIKE 'A%', the rows with null columns will be displayed too. I
will put '%' or 'A%' in a bind variable.

Thx.

--chris

----- Original Message -----
From: "Martijn Tonies" <m.tonies@...>
To: <firebird-support@yahoogroups.com>
Sent: Tuesday, April 27, 2004 6:09 PM
Subject: Re: [firebird-support] Null and LIKE Clause


> Some rows in some columns in a table contain null. When I SELECT them with
> LIKE clause on those columns, rows that contain null, not be selected. How
> to solve it?
>
> Table X
>
> Column1 Column2
> ===============
> AAA NULL
> AAB AAB
> AAC AAC
>
> SELECT * FROM X WHERE COLUMN2 LIKE '%'

OR COLUMN2 IS NULL

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com