How to arrange names to create pairs of names

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 ?
 
D

Dennis

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.
 
B

Baz

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
 
Top