FIND_IN_SET

2024-12-02 03:48:26  Updated

Syntax

FIND_IN_SET(str,strlist)

Purpose

FIND_IN_SET() returns the position, starting from 1, of the str string in the strlist string list. If str does not exist in strlist, 0 is returned. If str or strlist is NULL, NULL is returned.

The str string cannot contain commas (,).

Examples

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

Contact Us