Select SPV.PackageID0, SPV.PackageVer0 , Count(SPV.PackageVer0) as ‘Count’
from dbo.v_GS_SCANPACKAGEVERSION SPV
Group by SPV.PackageID0, SPV.PackageVer0