mysql 拆分字符串 为多行

SELECT
    substring_index(substring_index(a.chain,'_',b.help_topic_id + 1),'_' ,- 1)AS ID
FROM
    (select '1_11_1223_1242' as chain) a  
JOIN mysql.help_topic b ON b.help_topic_id <
(length(a.chain) - length( replace(a.chain, '_', '')  ) + 1)
posted @ 2023-04-18 14:25  寒冷的雨呢  阅读(313)  评论(0编辑  收藏  举报