https://blog.csdn.net/Saropetry/article/details/106496212
LIKE FIND_IN_SET LOCATE
MySQL :: MySQL 8.0 Reference Manual :: 12.8 String Functions and Operators https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_find-in-set
-
Returns a value in the range of 1 to
Nif the stringstris in the string liststrlistconsisting ofNsubstrings. A string list is a string composed of substrings separated by,characters. If the first argument is a constant string and the second is a column of typeSET, theFIND_IN_SET()function is optimized to use bit arithmetic. Returns0ifstris not instrlistor ifstrlistis the empty string. ReturnsNULLif either argument isNULL. This function does not work properly if the first argument contains a comma (,) character.mysql> SELECT FIND_IN_SET('b','a,b,c,d'); -> 2