mysql按分隔符输出多行

SELECT DISTINCT
    substring_index(substring_index(a.value, '\n', b.help_topic_id + 1), '\n',- 1) NAME
FROM t_cr_permission a
    JOIN mysql.help_topic b ON b.help_topic_id < (length(a.value) - length(REPLACE(a.value, '\n', '')) + 1)
WHERE a.id =1

posted @ 2021-05-24 05:43  tonggc1668  阅读(202)  评论(0编辑  收藏  举报