FIND_IN_SET(str,strlist) IN ():
mysql> select id, name from customer where find_in_set(id, '10,15,20');
+----+---------+
| id | name |
+----+---------+
| 10 | ten |
| 15 | fifteen |
| 20 | twelve |
+----+---------+
Thus, you do not need to bind an array with multiple values with IN(), you can pass the list of identifiers as a single line, separated by commas. You can safely use the PHP function implode()to generate a string from an array of identifiers.
Although, I'm not sure if this affects performance. I looked at the output explain, and it looks like it find_in_set()cannot use indexes, so query generation with a variable number of parameters should work better.
source
share