以表为例:table_event 表,字段有两个,id,scope; id:表主键,scope:为地市范围,多个以逗号隔开,例,郑州市,新乡市,开封市
结果:将scope根据地市拆成多行;
select SUBSTRING_INDEX(SUBSTRING_INDEX(a.scope,',',t.help_topic_id),',',-1) as scope FROM table_event a JOIN mysql.help_topic t
ON t.help_topic_id < LENGTH( a.scope ) - LENGTH(
REPLACE ( a.scope, ',', '' ))+1