> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# find_in_set

> Returns the 1-based position of a string within a comma-separated list.

This function returns the position of the first str in strlist (start counting with 1). Strlist is a sting separated by commas. If it does not find any str, it returns 0. When the argument is NULL, the result is NULL.

## Syntax

```Haskell theme={null}
INT find_in_set(VARCHAR str, VARCHAR strlist)
```

## Examples

```Plain Text theme={null}
MySQL > select find_in_set("b", "a,b,c");
+---------------------------+
| find_in_set('b', 'a,b,c') |
+---------------------------+
|                         2 |
+---------------------------+
```

## keyword

FIND\_IN\_SET,FIND,IN,SET


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.