mysql拆分逗号一列变多行

断了今生、忘了曾经 提交于 2019-11-27 05:01:46

需求:

 

SELECT 
DISTINCT substring_index(substring_index(a.value, ',', b.help_topic_id + 1), ',', - 1)
FROM TABLE a
INNER JOIN mysql.help_topic b
    ON b.help_topic_id < (length(a.value) - length(replace(a.value, ',', '')) + 1)

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!