VeloDB Cloud
SQL Manual
Functions
string-functions
find_in_set

find_in_set

Description

Syntax:

INT find_in_set(VARCHAR str, VARCHAR strlist)

This function returns the location where str first appears in strlist (counting from 1). strlist is a comma-separated string. If str is not found in strlist, it will return 0. If any argument is NULL, it will return 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