Why doesn't FIND_IN_SET return on NULL values Can anybody explain why FIND_IN_SET isn't returning the row with the NULL value? To me it seems obvious, the string "test", isn't part of NULL, so it should return it?

http://sqlfiddle.com/#!9/389043/2

CREATE TABLE test (
  id INT AUTO_INCREMENT,
  result VARCHAR(255),
  PRIMARY KEY (`id`)
);

INSERT INTO test (id, result) VALUES (1, NULL), (2, 'abc'), (3, 'abc,test');

SELECT * FROM test
WHERE
  NOT FIND_IN_SET('test', result);
Well, NULL is not a string, not even an empty one. When you compare to NULL special operators are of need, like column IS NULL or the NULL-safe comparator &lt;=&gt;.

Usually this is solved with a query like

SELECT * FROM test
WHERE
  NOT FIND_IN_SET('test', result)
  OR result IS NULL;


I for one think, that the FIND_IN_SET() function shouldn't exist at all. It makes it seem like having comma separated values in a column is absolutely normal and quite common. But it isn't. You shouldn't store the values this way. You have a lot of disadvantages (see this post for a probably incomplete list) and you should really look into database normalization. Like Bill says in the linked post, comma separated values violate the very first normal form already.