April 1, 2008 at 4:10 am
i have 3 tables like so below:
table -A
pid mid
--- ----
1 7
2 29
table -B
sid pid mid
--- --- ---
1 1 7
2 1 7
3 2 29
table -C
sid toy
--- ---
1 car
2 ball
3 toy phone
what i want is to loop through table A and C and add values sid,pid and mid into table -B
column sid,pid and mid in table -B isn't auto incremented
Any ideas and thanks in advance
April 1, 2008 at 4:54 am
Hi Patrick,
I'm not sure you'd need to use a loop. Would a cross join not work?
select sid, pid, mid
from testA, TestC
April 1, 2008 at 5:02 am
In your example, what values did you use from table A and table C to generate table B?
April 3, 2008 at 12:57 am
Patrick Ige (4/1/2008)
i have 3 tables like so below:table -A
pid mid
--- ----
1 7
2 29
table -B
sid pid mid
--- --- ---
1 1 7
2 1 7
3 2 29
table -C
sid toy
--- ---
1 car
2 ball
3 toy phone
what i want is to loop through table A and C and add values sid,pid and mid into table -B
column sid,pid and mid in table -B isn't auto incremented
Any ideas and thanks in advance
Patrick,
what is the relation between A and C table
if you do cross join you will get cortesan product records. check your resulted table
shamsudheen
April 3, 2008 at 3:32 am
thanks guys all fixed using cross joins
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply