By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
13 rows affected
| brand1 | brand2 | (No column name) |
|---|---|---|
| A | A | 4 |
| A | B | 3 |
| A | C | 2 |
| A | D | 2 |
| B | A | 3 |
| B | B | 4 |
| B | C | 3 |
| B | D | 1 |
| C | A | 2 |
| C | B | 3 |
| C | C | 3 |
| C | D | 0 |
| D | A | 2 |
| D | B | 1 |
| D | C | 0 |
| D | D | 2 |
Warning: Null value is eliminated by an aggregate or other SET operation.