with great_design_tab as (
select 700 as id, '1,11,32,531' as ass_pain from dual union all
select 701 as id, '2, 44, 321' as ass_pain from dual
)
,usrs as (
select 1 as id, 'вася' as username from dual union all
select 11 as id, 'петя' as username from dual union all
select 32 as id, 'костя' as username from dual union all
select 531 as id, 'дима' as username from dual union all
select 2 as id, 'жора' as username from dual union all
select 44 as id, 'изя' as username from dual union all
select 321 as id, 'семен' as username from dual
)
select u.id, u.username, t.id
from usrs u
,great_design_tab t
,lateral (
select level x from dual
connect by regexp_substr(ass_pain, '[^,]+', 1, level) is not null
)
where u.id = trim(regexp_substr(ass_pain,'[^,]+', 1, x));
ID USERNAME ID
---------- -------- ----------
1 вася 700
11 петя 700
32 костя 700
531 дима 700
2 жора 701
44 изя 701
321 семен 701