Opposite of MySQL FIND_IN_SET

Viewed 34253

How can I do the equivalent of:

!FIND_IN_SET('needle', haystack)
6 Answers

Equals to 0 doesn't work, you have to use null.

SELECT id FROM table WHERE FIND_IN_SET(needle,haystack) IS NULL

  .andWhere('(NOT FIND_IN_SET(:userID, notification.deletedBy) OR notification.deletedBy IS NULL)',{userID:userId})
Related