NULL safe NOT LIKE operation in mysql
mysql &gt; create table nsnl(a varchar(20));
Query OK, 0 rows affected (0.00 sec)

mysql &gt; insert into nsnl values (null), ('asdf');
Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql &gt; select * from nsnl;
+------+
| a    |
+------+
| NULL |
| asdf |
+------+
2 rows in set (0.00 sec)

mysql &gt; select * from nsnl where a not like 'as%';
Empty set (0.00 sec)

mysql &gt; select * from nsnl where a not like 'as%' or a is null;
+------+
| a    |
+------+
| NULL |
+------+
1 row in set (0.00 sec)


And that's how you can easily find that out yourself. Plus, when you do it yourself, you memorize it better. At least that works for me.