Skip to main content
Version: V1.4.1

FIND_IN_SET

Declaration​

FIND_IN_SET(str,strlist)

Description​

Returns the position of the specified string str in the string list strlist, starting from 1. If str is not found in strlist, it returns 0. If str or strlist is NULL, it returns NULL.

The string str cannot contain commas (,).

Examples​

SELECT FIND_IN_SET('b','a,b,c,d');
+----------------------------+
| FIND_IN_SET('b','a,b,c,d') |
+----------------------------+
| 2 |
+----------------------------+
1 row in set (0.001 sec)