A JSON array preserves element order and type. Inspect the distinction between a nested JSON value and a string containing JSON text.
Worked example
SELECT json_array(1,'build',NULL) AS payload;Result
[
{
"payload": "[1,\"build\",null]"
}
]Implementation notes
Constructors treat ordinary text differently from a value returned by a JSON function. Parse nested structures deliberately before embedding them.
Try it yourself
Include a number, a string and a null in the same array.
Open the SQL example →Editorial date March 26, 2026 · Published December 6, 2026