I have the following result.
The idea is the returned result for id2
to apply it in an in clause when that result is in one line and there are 2 ids for it
select 10 id1, '100,101' id2 from dual
union all
select 11 id1, '102,103' id2 from dual
the result of id2
to be applied in an in clause.