Subject Re: [firebird-support] Null and LIKE Clause
Author Martijn Tonies
> 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

Why? NULL doesn't equal/like '%'.

NULL is NO VALUE. It's a state. A column can have
two states: NULL or NOT NULL. It can have many
values though. You're using a value operator (LIKE).
Value operators don't operate on states (NULL).

The next best thing you can do, is perhaps something
with COALESCE:

WHERE COALESCE (Column2, '') LIKE '%'

> SELECT with option WHERE COLUMN2 LIKE 'A%", only rows with the first
> character is 'A' will be displayed.

With regards,

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