Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Snowflake select query to return data in json format

I am making a select call on a table and it always returns 1 row. I would like to get the data in json format.

{
  "column_name1": "value1",
  "column_name2": "value2",
}

Does snowflake query allows anything like this ?

like image 962
SunilS Avatar asked Feb 16 '26 15:02

SunilS


1 Answers

object_construct is the way to go for this.

For example,

select object_construct(*) from t1;
like image 78
d.hoeffer Avatar answered Feb 20 '26 11:02

d.hoeffer