with t1 as (select 1 as id union all select 2 union all select 3 union all select 4 union all select 5), t2 as (select '100,200,300' as client_id) select t1.id, regexp_substr(t2.client_id, 'd{3}', 1, t1.id) as client_id from t2 join t1 on 1=1 order by t1.id