Last active
June 29, 2020 21:13
-
-
Save dsolodow/83d3edc8e949a8aeac393fa70485f77f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT gcs.manufacturer0 AS Make | |
,IIF(gcs.manufacturer0 = 'Lenovo', gcsp.Version0, gcs.model0) AS Model | |
,COUNT(*) AS Count | |
FROM [CM_XXX].[dbo].[v_GS_COMPUTER_SYSTEM] gcs | |
INNER JOIN [CM_XXX].[dbo].[v_GS_COMPUTER_SYSTEM_PRODUCT] gcsp ON gcsp.ResourceID = gcs.ResourceID | |
GROUP BY Manufacturer0 | |
,CASE | |
WHEN gcs.Manufacturer0 = 'Lenovo' | |
THEN gcsp.Version0 | |
ELSE gcs.Model0 | |
END | |
ORDER BY Manufacturer0 | |
,Model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment