---
title: "Discussion on \"Counting Bit (true & false) in SQL\" | Hashnode"
description: "Discussion on \"Counting Bit (true & false) in SQL\". Here is how to count bit in SQL\nSELECT Id, count(1) as TotalCount, \nSUM(CASE WHEN Addressed = 1 THEN 1 ELSE 0 END) as AddressedCount \nFROM [dbo].[Alerts]"
url: "https://hashnode.com/posts/counting-bit-true-and-false-in-sql/60354965bc9bf67747fdc9ee"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Counting Bit (true & false) in SQL](https://cwizsoftware.com/counting-bit-true-and-false-in-sql?utm_source=hashnode&utm_medium=feed)

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\]

Aug 3, 2015 · 1 min read · cwizsoftware.com  
Read the article

-   [#sql-server](https://hashnode.com/tag/sql-server)

## Written by

[Xavier](https://hashnode.com/@xavier2021)

@xavier2021

  
[View profile](https://hashnode.com/@xavier2021)

C#

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
