By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| version |
|---|
| PostgreSQL 9.5.25 on x86_64-pc-linux-musl, compiled by gcc (Alpine 11.2.1_git20220219) 11.2.1 20220219, 64-bit |
SELECT 1
CREATE EXTENSION
INSERT 0 1
| section | status | count |
|---|---|---|
| A | Active | 1 |
| A | Inactive | 2 |
| B | Active | 4 |
| B | Inactive | 5 |
SELECT 4
| section | active | inactive |
|---|---|---|
| A | 1 | 2 |
| B | 4 | 5 |
SELECT 2