mysql> select * from user;
+------+----------+-----------+
| id | name | address |
+------+----------+-----------+
| | xiaobai | shandong |
| | xiaohong | suzhou |
| | xiaohei | changchun |
| | xiaoming | beijing |
+------+----------+-----------+
rows in set (0.00 sec) mysql> select * from user where find_in_set(cast(id as char),"1,2,3");
+------+----------+----------+
| id | name | address |
+------+----------+----------+
| | xiaobai | shandong |
| | xiaohong | suzhou |
| | xiaoming | beijing |
+------+----------+----------+
rows in set (0.00 sec)
参考: