I've managed to combine jsonb arrays using ||, but I'm not able to remove duplicates and 'N/A' from the jsonb array.
Current code :
SELECT
jsonb_path_query_array(column1, '$.key') ||
jsonb_path_query_array(column2, '$.key') ||
jsonb_path_query_array(column3, '$.key')
FROM
table;
Current output : (jsonb)
['N/A', 'N/A', 'N/A']
['N/A', 'AGENT', 'N/A']
['N/A', 'AGENT', 'AGENT']
['SYSTEM', 'N/A', 'N/A']
Desired output
NULL
AGENT
AGENT
SYSTEM