Counting Bit (true & false) in SQL
Here is how to count bit in SQL
SELECT Id, count(1) as TotalCount,
SUM(CASE WHEN Addressed = 1 THEN 1 ELSE 0 END) as AddressedCount
FROM [dbo].[Alerts]
Here is how to count bit in SQL
SELECT Id, count(1) as TotalCount,
SUM(CASE WHEN Addressed = 1 THEN 1 ELSE 0 END) as AddressedCount
FROM [dbo].[Alerts]