Mysql将一条记录中的某个字段拆分成多条记录
先运行看效果
select substring_index(substring_index('a,b,c,d',',',help_topic_id+1),',',-1) as test_val
from mysql.help_topic
where help_topic_id<(length('a,b,c,d')-length(replace('a,b,c,d',',',''))+1);
实例
select
dv.order_id
,dv.deliver_time
,substring_i
原创
2022-02-24 19:15:21 ·
4444 阅读 ·
1 评论