cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

How to connect 2 columns with 1 column? Relationship about home and away teams

I am creating a project about football games and I have 2 columns named HomeTeam and AwayTeam o a table named Games and I have another table name Teams that contains information about the teams, 1 team per line.


I need to create a relationship between this 2 tables (Games and Teams), but I can't connect the table Teams with column HomeTeam or column AwayTeam, it can't be "one or another", is there any to connect 2 columns with 1 column? 

When the user choose the game, for example, 49ers x Seahawks, the table teams should show information about this 2 teams.

 

Table Games

Id_GameHomeTeamAwayTeam
149ersSeahawks
2CowboysGiants
3CardinalsBengals
4BrownsPackers
5SteelersVikins

 

 

Table Teams

Name_TeamYear_FundationOther Information
49ers1950Info
Seahawks1946Info
Cowboys1976Info
Giants1980Info
Cardinals1840Info
Bengals1955Info
Browns1945Info
Packers1939Info
Steelers1971Info
Vikings1960Info

 

1 ACCEPTED SOLUTION

Accepted Solutions
rocky09 Established Member
Established Member

Re: How to connect 2 columns with 1 column? Relationship about home and away teams

may be you can use this way:

 

1. Create Duplicate table with the same data from Teams.  So, we have three tables. I call these as

   a. Games   b. Home Teams   c. Away Teams.

2. Now, create relationship based on names (see below).

 

relationship.png

 

Now, Use table visual to input fields like this and don't forget to select is not blank from the visual filter. (see below)

 

 

2019-03-18 11_16_22-Window.png

 

 

 

3 REPLIES 3
rocky09 Established Member
Established Member

Re: How to connect 2 columns with 1 column? Relationship about home and away teams

can you share some data of two tables??

Re: How to connect 2 columns with 1 column? Relationship about home and away teams

Hey @rocky09!

I updated the question with some data.

rocky09 Established Member
Established Member

Re: How to connect 2 columns with 1 column? Relationship about home and away teams

may be you can use this way:

 

1. Create Duplicate table with the same data from Teams.  So, we have three tables. I call these as

   a. Games   b. Home Teams   c. Away Teams.

2. Now, create relationship based on names (see below).

 

relationship.png

 

Now, Use table visual to input fields like this and don't forget to select is not blank from the visual filter. (see below)

 

 

2019-03-18 11_16_22-Window.png