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
Try this:
select * from names cross join (select rownum n from dual connect by level <= (select max(repeat) from names)) where n <= repeat order by name