SELECT DisplayName0, Count(*) AS 'Count', Publisher0, Version0, @CollID as CollectionID
FROM v_Add_Remove_Programs arp
JOIN v_FullCollectionMembership fcm on arp.ResourceID=fcm.ResourceID
WHERE fcm.CollectionID = @CollID
GROUP BY DisplayName0, Publisher0, Version0
ORDER BY Publisher0, Version0
|