将逗号分割的列,变成多列

SELECT substring_index(substring_index(t.delid,',', b.help_topic_id + 1), ',', -1)

FROM (SELECT su.* FROM sys_user su ) t

join mysql.help_topic b ON b.help_topic_id < (LENGTH(t.delid) - LENGTH(REPLACE(t.delid, ',', '')) + 1)

posted on 2017-11-04 16:03  一个帅哥9527  阅读(302)  评论(0编辑  收藏  举报