Suppose I have a table Products that looks like:
category | items
-----------------
fruit | {"apple", "banana"}
vegetable| {"carrot"}
and a table Prices that looks like:
name | price
----------------
apple | 1
banana | 2
carrot | 3
What's the simplest way to get an output like:
category | prices
-----------------
fruit | {1, 2}
vegetable| {3}
Feel free to use CTE or any other niceties that will make the query easy to read.