Thats true, but the actuall query looked more like this

SELECT * FROM testdb WHERE col1 LIKE '$var%'

and if I left the $var empty my plan was to get all columns. But I use the
"OR col1 IS NULL" trick which solved my problem.

Thanks anyway
/Jonas


If you want all values why not just do
SELECT *
FROM testdb
...
The `%` will not match NULL values.

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 3/3/04, 9:41:22 AM, "Jonas Lindén" <[EMAIL PROTECTED]> wrote
regarding LIKE % not including NULL values?:


> Hello list

> SELECT * FROM testdb WHERE col1 LIKE '%'

> The above SELECT statement doesnt return columns with NULL values.
> Should it? ;). Should I approce the problem in another direction?

> Regards
> /Jonas


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to