------------ select a2.id,substring_index(substring_index(a2.col2,',',a1.help_topic_id+1),',',-1) as split_rn from mysql.help_topic a1,tab_name2 a2 where a1.help_topic_id < (length(a2.col2)- length(replace(a2.col2,',','')) +1) ---------------------- 1、函数SUBSTRING_INDEX(str, delim, count) (1)参数str:需要拆分的字符串 (2)参数delim:分隔符,通过某字符进行拆分,用英文字符 (3)参数count:当 count 为正数,取第 n 个分隔符之前的所有字符; 当 count 为负数,取倒数第 n 个分隔符之后的所有字符。 -------------------------------------------