我是一个新代码,无法让子查询与主查询数据一起工作。本质上,我想从结果中计算出有多少台 PC 是 HP PC。当我运行它时,出现错误:无法绑定多部分标识符“dbo.softwareapplications.softwareid”。
select distinct appname, version, linkid,
(select count(make) as totalhp from dbo.workstations where make = 'Hewlett-Packard' and linkdid = t1.linkid)as totalhp
from dbo.softwareapplications as t1
join dbo.assignments on dbo.softwareapplications.softwareid = dbo.IQCSassignments.softwareid
join dbo.workstations on dbo.assignments.wsid = dbo.workstations.wsid
group by assetdescription, version, linkid, totalhp
任何帮助,将不胜感激。