MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Jonas Lindén Date:March 4 2004 7:41am
Subject:Re: LIKE % not including NULL values?
View as plain text  
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" <jonas.linden@stripped> 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

Thread
LIKE % not including NULL values?Jonas Lindén3 Mar
  • Re: LIKE % not including NULL values?at) domenca.si3 Mar
  • Re: LIKE % not including NULL values?Egor Egorov3 Mar
  • Re: LIKE % not including NULL values?vpendleton3 Mar
  • Re: LIKE % not including NULL values?Jonas Lindén4 Mar