query question

C

cinnie

greetings

Lets say I have 2 tables: the 1st table has a field, ID1, with records
a,b,c,d... and the 2nd table has a field, ID2, with records p,q,r,s...

What is a good way to make a query with Fields ID1 and ID2 that show all
combinations of 2 records, 1 from each table? Like this:

ID1 ID2
a p
a q
a r
a s
....etc
b p
b q
....etc

thank you
 
J

John W. Vinson

greetings

Lets say I have 2 tables: the 1st table has a field, ID1, with records
a,b,c,d... and the 2nd table has a field, ID2, with records p,q,r,s...

What is a good way to make a query with Fields ID1 and ID2 that show all
combinations of 2 records, 1 from each table? Like this:

ID1 ID2
a p
a q
a r
a s
...etc
b p
b q
...etc

thank you

A "Cartesian join" will do this. Just create a query; add both tables; don't
specify *any* join line. If Table1 has 1000 records and Table2 has 2000,
you'll get all 2,000,000 possible combinations.

This most often happens by mistake... but once in a while it's a legitimate
and useful thing to do.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top