如何查询显示所有老板名称

时间:2013-11-29 21:37:57

标签: sql ms-access join

如何在ms访问中进行查询以显示raid名称及其所有老板

enter image description here

Identyfikator - Id 纳兹瓦 - 姓名

1 个答案:

答案 0 :(得分:2)

SELECT r.Nazwa, b1.Nazwa AS BossName1, b2.Nazwa AS BossName2,
  b3.Nazwa AS BossName3, b4.Nazwa AS BossName4, b5.Nazwa AS BossName5
FROM ((((Raid AS r
  INNER JOIN Boss AS b1 ON r.Boss1 = b1.Identyfikator)
  INNER JOIN Boss AS b2 ON r.Boss2 = b2.Identyfikator)
  INNER JOIN Boss AS b3 ON r.Boss3 = b3.Identyfikator)
  INNER JOIN Boss AS b4 ON r.Boss4 = b4.Identyfikator)
  INNER JOIN Boss AS b5 ON r.Boss5 = b5.Identyfikator