一. 原始表中的数据:可以看到company_id与operate_area_ids字段之间的关系为1:n
二. 拆分成多行实现1:1关系
SELECT
a.company_id AS company_id,
substring_index( substring_index( a.operate_area_ids, ',', b.help_topic_id + 1 ), ',',- 1 ) operate_area_ids
FROM
company a
JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.operate_area_ids ) - length( REPLACE ( a.operate_area_ids, ',', '' ) ) + 1 )
where a.del_flag=0
结果为: