Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 501925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:14:22+00:00 2026-05-13T06:14:22+00:00

I have 2 tables that I need to get information from, and would like

  • 0

I have 2 tables that I need to get information from, and would like to get the information in one single query.

The situation is this :

table "matches" :

id
team_A_id
team_B_id

table "teams" :

id
name

The objective is to retrieve information from table “matches” (football matches) and join the information with the table “teams”. I need this because my webservice provider doesn’t have the xml data in my language (portuguese), and so I need to offer my client the option to translate certain team names to portuguese, otherwise I’d add the team names directly on the “matches” table. The problem is that I need to JOIN the 2 tables with 2 id’s. I know how to join tables with 1 id in common, but can’t figure out how to do it with 2 id’s, and mantaining the information from the 2 teams involved in each match intact.

Is this possible? Or do I have to create separate queries?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:14:22+00:00Added an answer on May 13, 2026 at 6:14 am
    select match.*, teama.name, teamb.name
    from matches as match
    inner join teams as teama on teama.id = match.team_A_id
    inner join teams as teamb on teamb.id = match.team_B_id
    

    would work in SQL Server and presumably MySQL too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple tables that need to be merged into one. SELECT name, SUM(money)
I have a database two tables and a linking table that I need a
I need to copy data from one table to another. The tables do not
I have a query that produces a result like this: The data is sorted
I have 2 tables in a DB with very similar schemas that need to
I have a two tables that are Subject and chapter . I need to
I have a few huge tables on a production SQL 2005 DB that need
I have a couple of tables in a SQL 2008 server that I need
I have a large database table that I need to display on a Windows
I have a table of data that I need to dynamically add a column

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.