JSON Scalar

to_json()

Arguments & returns

to_json(…)

Scalar
Overload link … Varargs Returns
#01 ANY JSON

… accepts a variable number of arguments of the type shown.

In other engines

BigQueryto_json_string()

TO_JSON_STRING(x)
In DuckDB
CAST(TO_JSON(x) AS TEXT)

SQLGlot example ↗

Prestojson_format()

JSON_FORMAT(x)
In DuckDB
CAST(TO_JSON(x) AS TEXT)

SQLGlot example ↗