SELECT @CollectionID as ‘collection’, CS.Model0 as Model, COUNT(*) AS ‘Count’
FROM v_GS_COMPUTER_SYSTEM  CS
inner join v_R_System R on CS.ResourceID = R.ResourceID
inner join v_FullCollectionMembership FCM on FCM.ResourceID = R.ResourceID
Where FCM.CollectionID = @CollectionID
GROUP BY CS.Model0
ORDER BY CS.Model0