您可以根据需要创建任意数量的内部连接...
select r.OwningTerritoryId ,rs1.ISRC , rs2.ISRC
from Resource rs1
inner join ReleaseResource rr2
on rr2.ResourceId=rs1.Id
inner join ReleaseResource rr2
on rr3.ResourceId=rs1.Id
inner join ReleaseResource rr3
on rr4.ResourceId=rs1.Id
inner join ReleaseResource rr4
on rr5.ResourceId=rs1.Id
虽然,[通常],您这样做的原因要求每个连接都有不同的连接条件。
如果您希望连接在一对中的每个表之间,然后在对之间,然后尝试:
select r.OwningTerritoryId ,rs1.ISRC , rs2.ISRC
from (Resource r1 join ReleaseResource rr1
On rr1.ResourceId = r1.Id)
join (Resource r2 join ReleaseResource rr2
On rr2.ResourceId = r2.Id)
On r2.id = r1.id -- Here put condition for this join between the pairs