Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Creating Dummy Records

601286Feb 13 2009 — edited Feb 15 2011
Hi, wondering if someone can give me some advise..I'm needing to create dummy records off some data, I need 10 total rows for each account number ( Field 2 ).

I've tried a few different ways such as using a ROW_NUMBER() over (partition by FIELD 2) then doing an outer join to

(select rownum r,field 1, field 2 from all_objects
where rownum < 11)

based on row num but I can't get this to work. I can't do this in my data, it has to be in a SQL statement. Anyone have suggestions?


My Data

Field 1 Field 2
10 1029
20 1029
10 1131
20 1131
30 1131
40 1131
50 1131

Desired Result

Field 1 Field 2
10 1029
20 1029
0 1029
0 1029
0 1029
0 1029
0 1029
0 1029
0 1029
0 1029
10 1131
20 1131
30 1131
40 1131
50 1131
0 1131
0 1131
0 1131
0 1131
0 1131

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 15 2011
Added on Feb 13 2009
9 comments
13,163 views