[Solved] Count SQL Query [closed]
Either of these will work. The second is better, but the first will show you how you can go about this when grouping by isn’t so straight-forward (or achievable). SELECT ISNULL(SUM(CASE WHEN OS_NAME = ‘Linux’ THEN 1 ELSE 0 END), 0) AS [Linux Servers], ISNULL(SUM(CASE WHEN OS_NAME = ‘Windows’ THEN 1 ELSE 0 END), 0) … Read more