Generate rows based on column value?
Hi All,
I would like to know if there is a function that can help me in generating rows based on a column value and, if so, which one. I'm on version 11.2.0.3.0
e.g. I have this table data:
ID M A C
1 5 3 5
2 9 2 3
Where ID is a unique ID of the record and the column C contains the number of records I would like to have returned for that ID. In this example, the record with ID 1 would be repeated 5 times and the record with id 2 would be repeated 3 times. The result would look like this:
ID M A C
1 5 3 5
1 5 3 5
1 5 3 5
1 5 3 5
1 5 3 5
2 9 2 3
2 9 2 3
2 9 2 3
The C column contains the number of record repetitions and is defined as a positive integer >= 1.
Of course, in real life the table contains (at this moment) 41 M number of records and the value of C can varies between 1 and 554, so hardcoding on the above example values is not possible.
Any pointers in the right direction are appreciated.
Regards,
Lennert