I have a problem with mysql select using "not like" in where conditions. There are 15k records in table. 3k records are with value 'test' in column col1.
This select works fine:
select
*
from
`table`
where
`col1` like 'test'
3000 rows selected. This is correct.
But if I try this select:
select
*
from
`table`
where
`col1` not like 'test'
0 rows selected while I expect 12000 rows.
I will be grateful for any ideas?
So I solved it. Problem was in data, not in request. I didn't realize that not like
condition doesn't work for NULL
value.
http://sqlfiddle.com/#!2/17270/2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With