Loading lesson path
Concept visual
Start at both ends
Search for "q" within the list of strings:
SELECT FIND_IN_SET("q", "s,q,l");The FIND_IN_SET() function returns the position of a string within a list of strings.
FIND_IN_SET( string, string_list )
Required. The string to search for string_list Required. The list of string values to be searched (separated by commas)
If string is not found in string_list, this function returns 0 If string or string_list is NULL, this function returns
If string_list is an empty string (""), this function returns 0
From MySQL 4.0
Search for "a" within the list of strings:
SELECT FIND_IN_SET("a", "s,q,l");Search for "q" within the list of strings (string list is NULL):
SELECT FIND_IN_SET("q", null);❮ MySQL Functions