find_in_set

description

Syntax

INT find_in_set(VARCHAR str, VARCHAR strlist)

“NOT found in set (VARCHAR str., VARCHAR strlist)”

Return to the location where the str first appears in strlist (counting from 1). Strlist is a comma-separated string. If not, return 0. Any parameter is NULL, returning NULL.

example

  1. mysql> select find_in_set("b", "a,b,c");
  2. +---------------------------+
  3. | find_in_set('b', 'a,b,c') |
  4. +---------------------------+
  5. | 2 |
  6. +---------------------------+

keyword

FIND_IN_SET,FIND,IN,SET