1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| with Formule as (Select 1 id, '+' signe, 2 ssformid_gauche, 3 ssformid_droit, null const From dual union all
Select 2 id, null signe, null ssformid_gauche, null ssformid_droit, 1 const From dual union all
Select 3 id, '*' signe, 4 ssformid_gauche, 5 ssformid_droit, null const From dual union all
Select 4 id, '*' signe, 6 ssformid_gauche, 7 ssformid_droit, null const From dual union all
Select 5 id, '*' signe, 8 ssformid_gauche, 9 ssformid_droit, null const From dual union all
Select 6 id, null signe, null ssformid_gauche, null ssformid_droit, 2 const From dual union all
Select 7 id, null signe, null ssformid_gauche, null ssformid_droit, 3 const From dual union all
Select 8 id, null signe, null ssformid_gauche, null ssformid_droit, 4 const From dual union all
Select 9 id, null signe, null ssformid_gauche, null ssformid_droit, 5 const From dual
)
Select Level, f.*,
SYS_CONNECT_BY_PATH(nvl(signe, const), ' ')
From formule f
Start With ID = 1
connect by (Prior ssformid_gauche = ID Or Prior ssformid_droit = ID) |
Partager