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
mysql将逗号隔开的字符串转换为表数据
最新推荐文章于 2024-02-27 16:35:18 发布