You need a join with multiple instances of 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
JOIN the Table2
two times with Table1
and add the proper alias names will solve in your request.
The working query is:
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.