FIND_IN_SET(str,strlist)
FIND_IN_SET function returns a value between 1 to N if the string str is in the string list strlist consisting of N substrings. If the first argument is a constant string and the second is a column of type SET, the FIND_IN_SET() function is optimized to use bit arithmetic. FIND_IN_SET returns 0 if str is not in strlist or if strlist is the empty string and it returns NULL if either argument is NULL. This function does not work properly if the first argument contains a comma (,) character.
mysql> select FIND_IN_SET('world.','Hello,World,How,are,you');
+-------------------------------------------------+
| FIND_IN_SET('world.','Hello,World,How,are,you') |
+-------------------------------------------------+
| 0 |
+-------------------------------------------------+
1 row in set (0.00 sec)
mysql> select FIND_IN_SET('world','Hello,World,How,are,you');
+------------------------------------------------+
| FIND_IN_SET('world','Hello,World,How,are,you') |
+------------------------------------------------+
| 2 |
+------------------------------------------------+
1 row in set (0.00 sec)
mysql> select FIND_IN_SET('ar','Hello,World,How,are,you');
+---------------------------------------------+
| FIND_IN_SET('ar','Hello,World,How,are,you') |
+---------------------------------------------+
| 0 |
+---------------------------------------------+
1 row in set (0.00 sec)
mysql> select FIND_IN_SET('are','Hello,World,How,are,you');
+----------------------------------------------+
| FIND_IN_SET('are','Hello,World,How,are,you') |
+----------------------------------------------+
| 4 |
+----------------------------------------------+
1 row in set (0.00 sec)
0 Comment(s)