语句:SELECT wid,substring_index(substring_index(unitType,’,’,c.help_topic_id+1),’,’,-1) AS unitType,chineseName FROM v_cultural_tourism_catalog_info
join mysql.help_topic c on c.help_topic_id < (length(unitType) - length(replace(unitType,’,’,’’))+1)
例如:表名:v_cultural_tourism_catalog_info
wid | unitType | chineseName |
1 | 1,2 | 上海 |
2 | 1 | 南京 |
wid | unitType | chineseName |
1 | 1 | 上海 |
1 | 2 | 上海 |
2 | 1 | 南京 |