把重复的字符串,拆分,然后转换成列的形式,再外套一个select distict v,转换后的字段
给你一个字段串,拆分后转成列的例子.
SELECT DISTINCT a.num from (
SELECT
SUBSTRING_INDEX(SUBSTRING_INDEX('7654,7698,7654,7782,7788',',',help_topic_id+1),',',-1) AS num
FROM
mysql.help_topic
WHERE
help_topic_id < LENGTH('7654,7698,7654,7782,7788')-LENGTH(REPLACE('7654,7698,7782,7788',',',''))+1)a