Dear All,
I would like to duplicate table rows basing a condition.
for example, I want to duplicate 2 times more each row having "value" = "X1" to obtain the result below :
id | value |
1 | X1 |
1 | X1 |
1 | X1 |
2 | X2 |
3 | X1 |
3 | X1 |
3 | X1 |
4 | X3 |
5 | X4 |
I tried to do that using connect by level, but I can't specify condition on "value" = "X1" :
with duplic as (select level l from dual connect by level <= 3)
select *
from my_table, duplic
order by id;
Thank you for your help!
Best regards