📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

JSON_STRIP_NULLS



Removes all properties with null values from a JSON object.

Syntax

JSON_STRIP_NULLS(<variant_expr>)

Arguments

An expression of type VARIANT.

Return Type

VARIANT.

Examples

SELECT JSON_STRIP_NULLS(PARSE_JSON('{"name": "Alice", "age": 30, "city": null}')) AS value; ╭───────────────────────────╮ │ value │ ├───────────────────────────┤ │ {"age":30,"name":"Alice"} │ ╰───────────────────────────╯

Was this page helpful?