Рекурсивный CTE может помочь.
SQL> with
2 test (cola, colb) as
3 -- sample data; you already have that
4 (select 'a', 'b' from dual union all
5 select 'c', 'd' from dual union all
6 select 'd', 'e' from dual union all
7 select 'b', 'c' from dual
8 ),
9 -- recursive CTE
10 temp (parent, child) as
11 (select t.cola parent, t.colb child
12 from test t
13 union all
14 select a.parent, b.colb child
15 from temp a join test b on a.child = b.cola
16 )
17 select *
18 from temp
19 order by parent, child;
PARENT CHILD
---------- ----------
a b
a c
a d
a e
b c
b d
b e
c d
c e
d e
10 rows selected.
SQL>