SELECT BTRIM('"enterprise"', '"')
> Output = enterprise
I need to use BTRIM function to trim the double quotes like above, with jsonb_array_elements function.
I have a query like below,
SELECT jsonb_array_elements(json_column->'Fields')->'field_name' as "column"
FROM table_a
Which returns
column
"Value1"
"Value2"
"Value3"
I need the output without double quotes like below.
column
Value1
Value2
Value3
2
Answers
Trim function is not required, just use
->>
to get JSON array elements as text :I think that you can use the
BTRIM
function to remove the " to the output ofjsonb_array_elements
casted to text: