Skip to content

FIND_IN_SET

  • str: This parameter represents the string to be found. It is the value that will be searched within the set provided in the strlist parameter.
  • strlist: This parameter represents the string list within which the search will be performed. It should be a list of substrings separated by commas, wherein the str parameter will be searched.
SELECT FIND_IN_SET('b', 'a,b,c,d');
2

The FIND_IN_SET function in MySQL is used to search for the position of a string within a list of strings separated by comma. The output ‘2’ denotes that ‘b’ is the second string in the set ‘a,b,c,d’.