FIND_IN_SET()

USAGE

FIND_IN_SET(find, set)

DETAILS

FIND_IN_SET() is a string function that searches for the first argument in a set (provided as a delimited string in the second 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 list string is empty.

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

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

SYNONYMS

SCHEMA

PARAMETERS

find

The string value expression to find.

set

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

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.08 Enterprise

  • Present starting in MariaDB Enterprise Server 23.08.0.

23.07 Enterprise

  • Present starting in MariaDB Enterprise Server 23.07.0.

10.6 Enterprise

  • Present starting in MariaDB Enterprise Server 10.6.4-1.

10.6 Community

  • Present starting in MariaDB Community Server 10.6.0.

10.5 Enterprise

  • Present starting in MariaDB Enterprise Server 10.5.3-1.

10.5 Community

  • Present starting in MariaDB Community Server 10.5.0.

10.4 Enterprise

  • Present starting in MariaDB Enterprise Server 10.4.6-1.

10.4 Community

  • Present starting in MariaDB Community Server 10.4.0.

10.3 Enterprise

  • Present starting in MariaDB Enterprise Server 10.3.16-1.

10.3 Community

  • Present starting in MariaDB Community Server 10.3.0.

10.2 Enterprise

  • Present starting in MariaDB Enterprise Server 10.2.25-1.

10.2 Community

  • Present starting in MariaDB Community Server 10.2.0.

Release Series

History

23.08 Enterprise

  • Present starting in MariaDB Enterprise Server 23.08.0.

23.07 Enterprise

  • Present starting in MariaDB Enterprise Server 23.07.0.

10.6 Enterprise

  • Present starting in MariaDB Enterprise Server 10.6.4-1.

10.5 Enterprise

  • Present starting in MariaDB Enterprise Server 10.5.3-1.

10.4 Enterprise

  • Present starting in MariaDB Enterprise Server 10.4.6-1.

EXTERNAL REFERENCES