, the field Tid holds the article tag ID, comma-delimited string, I now want to use the label to find out all the articles, such as "2", to find out all the Tid field has 2 of the article, now I use SELECT * from ' t_ms_article ' WHERE ' tid ' in (2) The statement can only be found to start with 2 of the article, and can not find out ' the "
I hope you can help me, I'm a rookie.
Reply to discussion (solution)
SELECT * from ' t_ms_article ' WHERE ' tid ' like '%2% ';
SELECT * from ' t_ms_article ' WHERE ' tid ' like '%2% ';
No, that way, you'll find 12 or 20 of these labels.
SELECT * from ' t_ms_article ' WHERE find_in_set (' 2 ', ' tid ')
SELECT * from ' t_ms_article ' WHERE CONCAT (', ', ' tid ', ', ') like '%,2,% ';
SELECT * from ' t_ms_article ' WHERE find_in_set (' 2 ', ' tid ')
Thank you, the solution, God please accept my knees!