Mar 27, 2006 #1 Naoise Programmer Dec 23, 2004 318 IE tbl1 A_ID | foo tbl2 B_ID | bar tbl3 Target table A_ID | B_ID How do I create tbl3? tbl1 and tbl2 will always have the same amount of rows.
tbl1 A_ID | foo tbl2 B_ID | bar tbl3 Target table A_ID | B_ID How do I create tbl3? tbl1 and tbl2 will always have the same amount of rows.
Mar 27, 2006 #2 Golom Programmer Sep 1, 2003 5,595 CA If you want every combination of A_ID and B_ID Code: INSERT INTO tbl3 (A_ID, B_ID) Select tbl1.A_ID, tbl2.B.ID From tbl1, tbl2 Upvote 0 Downvote
If you want every combination of A_ID and B_ID Code: INSERT INTO tbl3 (A_ID, B_ID) Select tbl1.A_ID, tbl2.B.ID From tbl1, tbl2
Mar 28, 2006 Thread starter #3 Naoise Programmer Dec 23, 2004 318 IE Not really looking for every combo. I have : tbl1 A_ID | foo 1 2 3 tbl2 B_ID | bar 1 2 3 Looking for tbl3 Target table A_ID | B_ID 1 1 2 2 3 3 but the sql above yields tbl3 Target table A_ID | B_ID 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3 Any thoughts? Upvote 0 Downvote
Not really looking for every combo. I have : tbl1 A_ID | foo 1 2 3 tbl2 B_ID | bar 1 2 3 Looking for tbl3 Target table A_ID | B_ID 1 1 2 2 3 3 but the sql above yields tbl3 Target table A_ID | B_ID 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3 Any thoughts?
Mar 28, 2006 #4 r937 Technical User Jun 30, 2002 8,847 CA any thoughts? yes! please describe how to determine which rows of table 1 should be matched to which rows of table 2 is it by equality of their respective ID column values? and what do you want done with a row from one table that doesn't match a row in the other? r937.com | rudy.ca Upvote 0 Downvote
any thoughts? yes! please describe how to determine which rows of table 1 should be matched to which rows of table 2 is it by equality of their respective ID column values? and what do you want done with a row from one table that doesn't match a row in the other? r937.com | rudy.ca