Using Lateral in Oracle 12c.
demo@ORA12C> select id,amount,discount_amount,currency,entity,
2 decode(r,1,'Line','Disc') as types
3 from xx_test_split , lateral( select level r
4 from dual
5 connect by level <= decode(discount_amount,0,1,2) )
6 /
ID AMOUNT DISCOUNT_AMOUNT CUR ENTITY TYPE
---------- ---------- --------------- --- ---------- ----
1001 100 0 USD ASSET Line
1002 900 18 USD INFRA Line
1002 900 18 USD INFRA Disc
and using Table/cast/multiset prior to that.
demo@ORA12C> select id,amount,discount_amount,currency,entity,
2 decode(column_value,1,'Line','Disc') as types
3 from xx_test_split , table( cast( multiset( select level r
4 from dual
5 connect by level <= decode(discount_amount,0,1,2) )
6 as sys.odcinumberlist) ) t2
7 /
ID AMOUNT DISCOUNT_AMOUNT CUR ENTITY TYPE
---------- ---------- --------------- --- ---------- ----
1001 100 0 USD ASSET Line
1002 900 18 USD INFRA Line
1002 900 18 USD INFRA Disc
demo@ORA12C>