答案 0 :(得分:0)
您需要连接多个table2实例
select b.name,c.name
from table1 a inner join table2 b on a.targetid=b.objectid
inner join table2 c on a.assignedid=c.objectid
答案 1 :(得分:0)
与Table2
两次加入Table1
,并添加适当的别名将在您的请求中解决。
有效查询是:
SELECT T2.Name AS ComputerName, T3.Name AS SoftwareName
FROM Table1 T1
JOIN Table2 T2 T2.ObjectId = T1.TargetId
JOIN Table2 T3 T3.ObjectId = T1.AssignedId