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!

PL/SQL for for loop numbers multiplication

AyhamOct 2 2012 — edited Oct 2 2012
hi All,

i have five numbers (from 1 to 5) i want to multiple each number with others six times but not with it's self.
that mean can not multiples 2*2 or 3*3 and so on

declare

begin
for i in 1..5 loop

for j in 1..5 loop
dbms_output.put_line(to_char(i) ||'*'||to_char(j));

end loop;

end loop;


end;
/


i want the output same the follwoing: Multiple each number with other numbers six time by sequential way.

1*2
1*2
1*2
1*2
1*2
1*2

1*3
1*3
1*3
1*3
1*3
1*3

1*4
1*4
1*4
1*4
1*4
1*4

1*5
1*5
1*5
1*5
1*5
1*5

2*3
2*3
2*3
2*3
2*3
2*3

2*4
2*4
2*4
2*4
2*4
2*4

2*5
2*5
2*5
2*5
2*5
2*5

3*4
3*4
3*4
3*4
3*4
3*4

3*5
3*5
3*5
3*5
3*5
3*5


4*5
4*5
4*5
4*5
4*5
4*5

regards
This post has been answered by Frank Kulash on Oct 2 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 30 2012
Added on Oct 2 2012
5 comments
1,429 views