Assuming I've a json column "my_json" in a psql table "A":
['key_A', 'key_B', 'key_C']
and a table B with records
| id | value |
|---|---|
| key_A | value_A |
| key_B | value_B |
| key_C | value_C |
, how can I join those 2 tables ? I tried
select
jsonb_array_elements_text(my_json) as key, BT.value
from A as AT
inner join B as BT
on AT.key = BT.id
but it does not work errror : column AT.key does not exists