find_in_set
find_in_setβ
descriptionβ
Syntaxβ
INT find_in_set(VARCHAR str, VARCHAR strlist)
"NOT found in set (VARCHAR str., VARCHAR strlist)"
Return to the location where the str first appears in strlist (counting from 1). Strlist is a comma-separated string. If not, return 0. Any parameter is NULL, returning NULL.
exampleβ
mysql> select find_in_set("b", "a,b,c");
+---------------------------+
| find_in_set('b', 'a,b,c') |
+---------------------------+
| 2 |
+---------------------------+
keywordsβ
FIND_IN_SET,FIND,IN,SET