//SELECT * FROM "test"
//drop table if exists test;
//create table test(id int,ids varchar(50));
//insert into test
//select 1,'1,12,135' union all
//select 2,'2,25,234';
---------------------------------------------------------------------------
with split(id,splid,idsstr) as
(
select id,'',ids||',' from test
UNION ALL
SELECT id,substr(idsstr, 0, instr(idsstr, ',')),substr(idsstr, instr(idsstr, ',')+1)
FROM split WHERE idsstr!=''
)
select id,splid from split
where splid != ''
order by id ;
----------------------------------------------------------------------------
引用文章
https://www.jianshu.com/p/6cfc77bb8ff9