Look for the occurrence of “q” within the list of strings.
SELECT FIND_IN_SET(“q”, “s,q,l”); |
The FIND_IN_SET() function retrieves the position of a string within a comma-separated list of strings.
FIND_IN_SET(string, string_list) |
Parameter |
Description |
string |
Necessary: The string to be searched. |
string_list |
Necessary: The list of string values to search within, separated by commas. |
Works in: | From MySQL 4.0 |
Find the occurrence of “a” within the provided list of strings.
SELECT FIND_IN_SET(“a”, “s,q,l”); |
Look for “q” within the list of strings (if the string list is NULL).
SELECT FIND_IN_SET(“q”, null); |