It turns out that Mysql can make such a query
SELECT ID, LIST, NAME from Table Where 'DaoDao' In (List); (1)
Note: 1. Table contains three fields ID: int, List: varchar (255), name: varchar (255)
In fact, this is not good, so only when Name is the first element in the list, the query is valid, otherwise it will not be the result, even if 'daodao' really List
Let's take a look at this:
Select ID, List, Name from Table Where 'DaoDao' In ('Libk', 'Zyfon', 'DaoDao'); (2)
This is ok
-------------------------------------------------- -------
What is the difference between these two? Why can't the first result cannot achieve the correct result, and the second can achieve the results.
The reason is actually (1) middle (list) List is a variable, and in (2) ('libk', 'zyfon', 'DaoDao') is constant
So if you want to make (a) work correctly, you need to use Find_in_SET ():
SELECT ID, LIST, NAME from Table Where Find_IN_SET ('DAODAO', LIST); (1) Improvement Edition.
Summary: So if the List is constant, you can use IN directly, otherwise you want to use the FIND_IN_SET () function.