我有4张桌子:
您需要查询才能获得下表:
Main.ID, A1.NameA1, A2.NameA2, A3.NameA3
where Main.ID for example = 12
提前感谢您的合作
答案 0 :(得分:0)
您应该使用JOIN来加入这些表。
SELECT Main.ID
,A1.NameA1
,A2.NameA2
,A3.NameA3
FROM Main
INNER JOIN A1 ON Main.A1_ID = A1.A1_ID
INNER JOIN A2 ON Main.A2_ID = A2.A2_ID
INNER JOIN A3 ON Main.A3_ID = A3.A3_ID
WHERE Main.ID = 12