我不是 T-SQL Extrodinare,我是应用开发人员。有了这个,我无法弄清楚为什么这个计数会永远持续下去。
select p.Code,
count(p.Head) as HeadCount,
p.Wt
from Povs p
left outer join Sales s on SheetKey = p.SheetKey
left outer join Site [site] on [site].CompanyKey = s.CompanyKey
left outer join Lot lot on lot.LotID = s.LotID
group by lot.LotID, [site].SiteKey, Code, Wt
Povs 中有大约 115749000 条记录。