---
title: "Discussion on \"Creating histogram in SQL using Case... When\" | Hashnode"
description: "Discussion on \"Creating histogram in SQL using Case... When\". To create a histogram using the CASE WHEN concept in SQL, you can use the CASE statement to categorize data into bins and then aggregate the counts for each bin. Here's an example:\nLet's say you have a table called sales with a column named amount th..."
url: "https://hashnode.com/posts/creating-histogram-in-sql-using-case-when/647abd528990276fcd853970"
---

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

Discussion

# [Creating histogram in SQL using Case... When](https://sihan.hashnode.dev/creating-histogram-in-sql-using-case-when?utm_source=hashnode&utm_medium=feed)

To create a histogram using the CASE WHEN concept in SQL, you can use the CASE statement to categorize data into bins and then aggregate the counts for each bin. Here's an example: Let's say you have a table called sales with a column named amount th...

Jun 3, 2023 · 2 min read · sihan.hashnode.dev  
Read the article

## Written by

[Data Sensei](https://hashnode.com/@sibbirsihan)

@sibbirsihan · United Kingdom

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

for the data, by the data, of the data

A data analytics engineer with four years of experience working as a data engineer. Holds a MSc in Data.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
