> ## 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

> 返回逗号分隔的字符串列表中指定字符串第一次出现的位置（从1开始计数）。

返回 strlist 中第一次出现 str 的位置 (从 1 开始计数)。如果没有找到返回 0，任意参数为 NULL 就返回 NULL。

## 语法

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

## 参数说明

`str`: 支持的数据类型为 VARCHAR。

`strlist`: 是用逗号分隔的字符串，支持的数据类型为 VARCHAR。

## 返回值说明

返回值的数据类型为 INT。

## 示例

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


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