I am using the following query:
WITH a as (SELECT unnest(string_to_array(animals, ',')) as "pets" FROM all_animals where id = 100)
select * from a
which returns the following data:
1 Cat
2 Dog
3 Bird
My question is, how can I format my string_to_array
select above to include single quotes for the returned data to look like this:
1 'Cat'
2 'Dog'
3 'Bird'