By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Records: 17 Duplicates: 0 Warnings: 0
| initial | data | count(*) |
|---|---|---|
| a | aardvark | 1 |
| a | accordion | 1 |
| a | apple | 1 |
| a | null | 3 |
| b | banana | 1 |
| b | banjo | 1 |
| b | null | 2 |
| c | cherry | 1 |
| c | cockatoo | 1 |
| c | cor anglais | 1 |
| c | null | 3 |
| d | date | 1 |
| d | dobro | 1 |
| d | dromedary | 1 |
| d | null | 3 |
| e | elderberry | 1 |
| e | elephant | 1 |
| e | euphonium | 1 |
| e | null | 3 |
| f | fig | 1 |
| f | fleugel horn | 1 |
| f | null | 2 |
| g | giraffe | 1 |
| g | null | 1 |
| null | null | 17 |
Incorrect usage of CUBE/ROLLUP and ORDER BY