Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL help
"RJ" <ridwan.jeena_at_gmail.com> a écrit dans le message de news: 1159427739.862730.228360_at_h48g2000cwc.googlegroups.com...
| 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...
|
SQL> select * from t2;
NOM NO_CASES
---------- ----------
Smith 2 John 3 Mary 2 Kate 1
4 rows selected.
SQL> with
2 rn as (
3 select rownum rn from dual 4 connect by level <= (select max(no_cases) from t2)5 )
8 rows selected.
Regards
Michel Cadot
Received on Thu Sep 28 2006 - 10:55:53 CDT
![]() |
![]() |