If a string is found in a string list with N substrings, the “Find in set” function returns a value in the “1 to N” range. Using commas to separate each substring makes a string list (,). The FIND IN SET() function is streamlined to use bit arithmetic if the first parameter is a constant string and the second argument is a column of type SET. If the string isn’t found in the string list, returns 0. If either parameter is NULL, NULL is returned. If there is a comma (,) in the first argument, this function will not function correctly.
In short, the FIND_IN_SET() function returns the position of a string within a list of strings.
Examples:
SELECT FIND_IN_SET(‘Sports’,’Sports,Games,Arts,Crafts’);
This function can be used in WHERE clause too.
SELECT * FROM Emp WHERE find_in_set(‘MANAGER’,Job) <> 0;
Hope you find this article helpful.