How to remove a list and make it just comma separated in Snowflake column?

I have a list in a column in Snowflake table as shown below. All I want to do is to remove the brackets and double quotes and just keep it as comma separated. Please help me achieve this.

[
  "Availability",
  "Category Level 1",
  "Crawl Date",
  "Price",
  "Retailer"
]

Expcted:

  Availability,
  Category Level 1,
  Crawl Date,
  Price,
  Retailer

>Solution :

ARRAY_TO_STRING converts an array to text:

SELECT ['Availability',
        'Category Level 1',
        'Crawl Date',
        'Price',
        'Retailer' 
       ] AS arr
  ,ARRAY_TO_STRING(arr, ',');

Output:

enter image description here

Leave a Reply