Skip to main content

JSON_STRIP_NULLS

Introduced or updated: v1.2.762

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"} │
╰───────────────────────────╯
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today