MySQL selects two tables at the same time

I have two tables and you want to make a query. I tried to get the AA command and the BB image command on table A.

I used:

SELECT tableA.team1, tableA.team2, tableB.team, tableB.image,

FROM tableA 

LEFT JOIN tableB ON tableA.team1=tableB.team

The result displays only the image A in the column. Is there a way to select image A and image B without using a second query? I appreciate any help! Many thanks!

My table structure:

table A

team1 team2
------------
 AA    BB

table B

 team  image
-------------
  AA   imagaA
  BB   imageB
+5
source share
1 answer

It will be something like:

SELECT tableA.team1, tableA.team2, tableB.team, tableB.image, tb.image

FROM tableA 

LEFT JOIN tableB ON tableA.team1=tableB.team
LEFT JOIN tableB tb ON tableA.team2=tb.team
+6
source

All Articles