SELECT
substring_index( substring_index( a.label, '/', b.help_topic_id + 1 ), '/',- 1 )
AS label
FROM
sys_industryknowledge a
JOIN mysql.help_topic b
ON b.help_topic_id < (length( a.label ) - length( REPLACE ( a.label, '/', '' ) ) + 1 )
得到如下图结果
再加上distinct可查询出不重复的数据
SELECT
distinct substring_index( substring_index( a.label, '/', b.help_topic_id + 1 ), '/',- 1 )
AS label
FROM
sys_industryknowledge a
JOIN mysql.help_topic b
ON b.help_topic_id < (length( a.label ) - length( REPLACE ( a.label, '/', '' ) ) + 1 )