By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| CounterId | Counter | CounterName |
|---|---|---|
| 1 | 0 | Shoes |
| 2 | 0 | Widgets |
| @CounterName | @Counter |
|---|---|
| Widgets | 1 |
| CounterId | Counter | CounterName |
|---|---|---|
| 1 | 0 | Shoes |
| 2 | 1 | Widgets |
| @CounterName | @Counter |
|---|---|
| Widgets | 2 |
| CounterId | Counter | CounterName |
|---|---|---|
| 1 | 0 | Shoes |
| 2 | 2 | Widgets |
| @CounterName | @Counter |
|---|---|
| Shoes | 1 |
| CounterId | Counter | CounterName |
|---|---|---|
| 1 | 1 | Shoes |
| 2 | 2 | Widgets |