Subject | Null and LIKE Clause |
---|---|
Author | Christianto Tjahyadi |
Post date | 2004-04-27T11:04:58Z |
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 '%'
The result are:
Column1 Column2
===============
AAB AAB
AAC AAC
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 '%'
The result are:
Column1 Column2
===============
AAB AAB
AAC AAC