Converts a BigQuery value to a JSON string representation.
STRINGDiperbarui: 13 Jun 2026TO_JSON_STRING(expression [, pretty_print])The value to convert
Format with indentation (default: false)
1 SELECT 2 TO_JSON_STRING(STRUCT('John' as name, 30 as age)) as compact, 3 TO_JSON_STRING(STRUCT('John' as name, 30 as age), TRUE) as pretty;
Compact vs pretty-printed JSON string output.
| compact | pretty |
|---|---|
| {"name":"John","age":30} | { |
| "name": "John", | |
| "age": 30 | |
| } |
Sudah paham TO_JSON_STRING? Latih langsung di browser
Latihan interaktif, langsung di browser.