Month: June 2020

Count of Models

Here is a query query for count of computer Models. ;with m as (SELECTCS.Manufacturer0 as ‘Manufacturer’,case CS.Manufacturer0When ‘LENOVO’ then CSP.Version0else CS.Model0end as ‘Model’FROMdbo.v_R_System_Valid RVjoin dbo.v_GS_COMPUTER_SYSTEM CS on RV.ResourceID = CS.ResourceIDjoin dbo.v_GS_COMPUTER_SYSTEM_PRODUCT CSP on RV.ResourceID = CSP.ResourceID)SelectM.Manufacturer,M.Model,Count(*) as ‘total’from MGroup byM.Manufacturer,M.ModelOrder byM.Manufacturer,M.Model