views:

46

answers:

1

Hi all I have two tables and want to make a query. I tried to get team AA and team BB's image base 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 only display imageA on the column. Are there any ways to select imageA and image B without using the second query? I appreciate any helps! Thanks a lot!

My table structure are:

table A

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

table B

 team  image
-------------
  AA   imagaA
  BB   imageB
+6  A: 

That would 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
jeroen
AWESOME!!!! Thanks for the quick reply Jeroen!
Jerry
You're welcome!
jeroen