MySQL select two tables at the same time...

Posted by Jerry on Stack Overflow See other posts from Stack Overflow or by Jerry
Published on 2010-05-19T01:02:53Z Indexed on 2010/05/19 1:10 UTC
Read the original article Hit count: 195

Filed under:
|
|
|

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

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql