Converts a BigQuery value to the native JSON type.
JSONDiperbarui: 13 Jun 2026TO_JSON(expression)The value to convert to JSON
1 SELECT 2 TO_JSON(STRUCT('John' as name, 30 as age)) as json_obj, 3 TO_JSON([1, 2, 3]) as json_array;
Converts a STRUCT and an ARRAY to JSON.
| json_obj | json_array |
|---|---|
| {"name":"John","age":30} | [1,2,3] |
Sudah paham TO_JSON? Latih langsung di browser
Latihan interaktif, langsung di browser.