I have a table on a Oracle DB with two columns. I would like to see every row repeated as many times as the number stored in the second column. The table looks like this:
select a1.col1 , a1.col2
from a a1
join (select level col2 from dual
connect by level < ( select max(col2) + 1 from a)) a2
on a2.col2 between 1 and a1.col2