By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
3 rows affected
| id | fruit | flavors | flavor |
|---|---|---|---|
| 1 | apple | {sweet,sour,delicious} | sweet |
| 1 | apple | {sweet,sour,delicious} | sour |
| 1 | apple | {sweet,sour,delicious} | delicious |
| 2 | apple | {sweet,tasty} | sweet |
| 2 | apple | {sweet,tasty} | tasty |
| 3 | banana | {sweet,delicious} | sweet |
| 3 | banana | {sweet,delicious} | delicious |
| fruit | array_agg | count |
|---|---|---|
| apple | {delicious,sour,sweet,tasty} | 2 |
| banana | {delicious,sweet} | 1 |