By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| ID | Field1 | Field2 | g1 | g2 |
|---|---|---|---|---|
| 1 | A | A | g1A description | g2A description |
| 2 | B | B | g1B description | g2B description |
| 3 | C | C | g1C description | g2C description |
Warning: Null value is eliminated by an aggregate or other SET operation.
| ID | Field1 | Field2 | Groups |
|---|---|---|---|
| 1 | A | A | {"g1":"g1A description","g2":"g2A description"} |
| 2 | B | B | {"g1":"g1B description","g2":"g2B description"} |
| 3 | C | C | {"g1":"g1C description","g2":"g2C description"} |
Warning: Null value is eliminated by an aggregate or other SET operation.