mysqlsqldatabaseset

Opposite of MySQL FIND_IN_SET


How can I do the equivalent of:

!FIND_IN_SET('needle', haystack)

Solution

  • FIND_IN_SET returns the index of the match if it is found, and returns 0 if it is not found. Since 0 is FALSE you can use NOT FIND_IN_SET('needle', haystack)