I have an array column called fields in table tt_test as follows:
fields
{A}
{B,C}
{D}
{E}
Table tt_config contains a field_id for each field:
field field_id
A 1
B 2
C 3
D 4
E 5
From the two tables above, I need to create a third called tt_output
fields field_ids
{A} {1}
{B,C} {2,3}
{D} {4}
{E} {5}
Fairly new to postgresql/sql so any help/pointers would be appreciated!