我有两个表,想要查询.我试图在A桌上获得AA队和BB队的形象基础.
我用了:
SELECT tableA.team1, tableA.team2, tableB.team, tableB.image,
FROM tableA
LEFT JOIN tableB ON tableA.team1=tableB.team
Run Code Online (Sandbox Code Playgroud)
结果只显示列上的imageA.有没有办法在不使用第二个查询的情况下选择imageA和图像B?我感谢任何帮助!非常感谢!
我的表结构是:
表A.
team1 team2
------------
AA BB
Run Code Online (Sandbox Code Playgroud)
表B.
team image
-------------
AA imagaA
BB imageB
Run Code Online (Sandbox Code Playgroud)
这将是这样的:
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
Run Code Online (Sandbox Code Playgroud)