I have a query which in I joined twice the same table, i.e:
left join tag tag1 [...]
left join tag tag2 [...]
I would like to have query with one column called tag
which in I will have unique values from both tables (tag1
, tag2
).
Example:
For now I am able to select unique values from each one column with jsonb_agg(distinct tag_name)
and in my query I have two columns:
tag1 | tag2
[Sport, Music] | [Sport, Games]
And I would like to have one column with unique values from tag1
and tag2
like:
tag
[Sport, Music, Games]