SELECT c.id,c.s from(select a.id,substring_index(substring_index(a.tag,',',b.help_topic_id+1),',',-1) as s
from
[表名] a
join
mysql.help_topic b
on b.help_topic_id < (length(a.tag) - length(replace(a.tag,',',''))+1)
order by a.id) c WHERE FIND_IN_SET (c.s,'aa')
mysql a表中tag字段存"aa,bb,cc"多条件插分遍历查询
最新推荐文章于 2021-03-17 01:44:27 发布