需求:
注意:help_topic表可以换成任意一个id从1开始连续自增的表。确保id的最大值超过要拆分的数量即可。没有必要非用这个表。尤其是help_topic表访问受限制的情况下,可以特意创建从1自增的表来替代
SELECT
a.assess_iep_id,
SUBSTRING_INDEX(SUBSTRING_INDEX(a.related_pass_iep_id, ',', b.help_topic_id + 1), ',' ,- 1) related_pass_iep_id
FROM
dh_hc_assess_related_iep a
INNER JOIN mysql.help_topic b ON b.help_topic_id < (
LENGTH(a.related_pass_iep_id) - LENGTH(REPLACE(a.related_pass_iep_id, ',', '')) + 1)