Subject | Re: [firebird-support] Null and LIKE Clause |
---|---|
Author | Christianto Tjahyadi |
Post date | 2004-04-27T12:27:09Z |
I expect, when I do a SELECT with option WHERE COLUMN2 LIKE '%', all of rows
will be displayed, including the rows with COLUMN2 is null. But when I do a
SELECT with option WHERE COLUMN2 LIKE 'A%", only rows with the first
character is 'A' will be displayed.
--chris
will be displayed, including the rows with COLUMN2 is null. But when I do a
SELECT with option WHERE COLUMN2 LIKE 'A%", only rows with the first
character is 'A' will be displayed.
--chris
----- Original Message -----
From: "Martijn Tonies" <m.tonies@...>
To: <firebird-support@yahoogroups.com>
Sent: Tuesday, April 27, 2004 7:01 PM
Subject: Re: [firebird-support] Null and LIKE Clause
Hi,
> 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.
So, what do you expect? LIKE is a comparison
operator, while IS NULL isn't.
No column value ('A' or whatever) will ever equal
NULL.
NULL = NULL results into False.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com