How to arrange names to create pairs of names

  • Thread starter Thread starter aeronav
  • Start date Start date
A

aeronav

Hi !
I have a table of Agents with ID_Agent as primary key and LastName as text
field, ex.
ID_Agent LastName
1 BOBET
2 MAGNE
3 VIETTO
I want to create a query (to create a table) which will associate each
LastName wiyh itself and all the others, like
BOBET BOBET
BOBET MAGNE
BOBET VIETTO
MAGNE BOBET
MAGNE MAGNE
MAGNE VIETTO
VIETTO BOBET
VIETTO MAGNE
VIETTO VIETTO
All my attempts were a mess, can any one help me ?
 
Create a query and add the Agents table twice.
Select LastName from the first Agents table as column 1 and Select LastName
from the second Agents table as column 2. Run the query to check it is OK and
then change it to a make table query.
 
aeronav said:
Hi !
I have a table of Agents with ID_Agent as primary key and LastName as text
field, ex.
ID_Agent LastName
1 BOBET
2 MAGNE
3 VIETTO
I want to create a query (to create a table) which will associate each
LastName wiyh itself and all the others, like
BOBET BOBET
BOBET MAGNE
BOBET VIETTO
MAGNE BOBET
MAGNE MAGNE
MAGNE VIETTO
VIETTO BOBET
VIETTO MAGNE
VIETTO VIETTO
All my attempts were a mess, can any one help me ?

Sounds like you want a cross-join.

SELECT Agents.LastName, Agents_1.LastName INTO new_table
FROM Agents, Agents AS Agents_1
 

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

Back
Top