Mysql's FIND_IN_SET () usage FIND_IN_SET (str, strlist) returns the serial number of str in the strlist of the string set (if any parameter is NULL, NULL is returned. If str is not found, 0 is returned, an exception occurs when parameter 1 contains ",".) Example: query the table field pingid = (, 3,) SELECT * FROM 'linkinfo 'WHERE 'pingid' REGEXP' {id }, 'AND 'pingid' not regexp' [[: alnum:] + {id}, 'Use the preceding statement to query AND use FIND_IN_SET () simpler SELECT * FROMlinkinfoWHEREFIND_IN_SET ('1', pingid) originally thought mysql could perform such queries: select id, list, name from table where 'daodao 'IN (list); (1) note: 1. table contains three fields: int, list: varchar (255), name: varchar (255). In this way, only when name is the first element in the list, the query is valid. Otherwise, no results will be returned. Even if 'daocao' is actually IN the list, let's take a look at this: select id, list, name from table where 'daocao' IN ('libk ', 'zyfon', 'daodao '); (2) can it be ------------------------------------------------------------- what is the difference between the two? Why can't the first one get the correct result, but the second one get the result. The reason is that (1) in (list) list is a variable, and (2) in ('libk', 'zyfon', 'daodao ') is a constant, so if you want (1) to work correctly, use find_in_set (): select id, list, name from table where FIND_IN_SET ('daodao ', list); (1). Conclusion: If list is a constant, you can use IN directly; otherwise, use the FIND_IN_SET () function.