I have been trying to achieve this in SQL (Oracle 11g) for a while but could not find a proper way to do it.
My table names has the following rows:
names
I just found an alternative with connect by and correlated sub-query.
select name from names o connect by level <= ( select repeat from names i where i.name = o.name ) AND prior name = name and prior sys_guid() is not null order by name;