FIND_IN_SET()

Overview

Returns the position of a string in a set of comma-separated substrings.

USAGE

FIND_IN_SET(find, set)

Argument Name

Description

find

The value that is being searched for

set

A single string that contains a comma-separated list of text values

DETAILS

FIND_IN_SET() is a string function that searches for the find argument in the set argument and returns a 1-based index of the result.

The return value is 0 if the find string is not found or if the find string is empty.

All comparisons are string versus string, with any non-string arguments being first converted into a string.

Character comparisons are case-insensitive.

A NULL is returned if either of the arguments is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT FIND_IN_SET('a', 'm,a,r,i,a,d,b');
+-----------------------------------+
| FIND_IN_SET('a', 'm,a,r,i,a,d,b') |
+-----------------------------------+
|                                 2 |
+-----------------------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES