Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL help
RJ wrote:
> Hi all,
>
> I have the follwoing table (abc):
>
> NAME NO_CASES
> --------- -------------------
>
> Smith 13
> John 9
> Mary 5
> Kate 23
>
> I want to insert into another table (xyz) as follows:
>
> Smith must be inserted 13 times (13 rows), John 9 times (9 rows) etc..
> for all the records in the table.
>
> How will I do this?
>
> Thanks in advance...
You can do this on a single row.
( select name
from t connect by level <= no_case );
Won't work on multiple rows, though, so you might have to put it in a cursor loop. Not sure if there is a way to do it directly in a single query. Received on Thu Sep 28 2006 - 12:55:46 CDT
![]() |
![]() |