创建表,数据:
create table t(str varchar(100))
insert into t values ('0,1,2,34')
执行:
SELECTgroup_concat(
RIGHT (
concat(
'00',
substring_index(
substring_index(
a.str,
',',
b.help_topic_id + 1
),
',' ,- 1
)
),
3
)
)
FROM
t a
JOIN mysql.help_topic b ON b.help_topic_id < (
length(a.str) - length(REPLACE(a.str, ',', '')) + 1
)
结果:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)