Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining two tables to create multiple records 1

Status
Not open for further replies.

mightyatom13

Technical User
Oct 1, 2002
21
US
I am trying to join two tables into a third table to create every possible combination of the two and am not sure how to do this. Here is a simplified version of what I need to do. Take a table whose only data is three first names and join it with a table whose only data is three last names to create a table with all nine combinations of first and last names. Any pointers would be appreciated.

Jeff
 
Jeff

Try creating a SELECT statement without any JOINS or WHERE clauses. You are basically "multiplying" the tables.

[tt]
SELECT A.Name1, A.Name2, A.Name3, B.Name1, B.Name2, B.Name3
FROM FirstTable as A, SecondTable as B
[/tt]
 
Thank you so much. That worked perfectly! I have spent so much time on this problem. You have made me look great in front of my boss. Have a star!

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top