# Open Cases by Priority

**Type:** SOQL · **Difficulty:** Medium · **Topics:** GROUP BY, Aggregates

Practice this problem interactively (write and run your SOQL against realistic data): https://www.forcechallenges.com/problems/open-cases-by-priority

## Problem

The support manager needs a dashboard tile showing how many **open** cases exist per priority.

Return one row per `Priority` with the number of Cases whose `Status` is **not** `'Closed'`. Alias the count as `total`. Sort by `Priority` ascending.

### Expected shape
| Priority | total |
|---|---|
| High | 42 |
| Low | 17 |

## Constraints

- Use an aggregate query (`COUNT(Id)`), aliased `total`.
- Cases with a null Priority form their own group.
- Row order is checked.

---
Source: ForceChallenges · last updated 2026-10-02
