原表如下:
将【actual_place_id】转列,效果如下:
方法:
select e.logical_place_name, substring_index(substring_index(e.actual_place_id, ',', h.help_topic_id + 1), ',', -1) as actual_place_id
from ec_logicplace e
cross join mysql.help_topic h
where h.help_topic_id <(length(e.actual_place_id)-length(replace(e.actual_place_id,',',''))+1)