mysql将逗号隔开的字符串转换为表数据

来源:互联网 发布:mac微信怎么视频 编辑:程序博客网 时间:2024/06/06 02:46

INSERT INTO tmp_split SELECT
a.id,
substring_index(
substring_index(
a.ids,
‘,’,
b.help_topic_id + 1
),
‘,’ ,- 1
)
FROM
test a
JOIN mysql.help_topic b ON b.help_topic_id < (
length(a.ids) - length(REPLACE(a.ids, ‘,’, ”)) + 1
)
ORDER BY
a.ID

阅读全文
0 0
原创粉丝点击