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

NULLIF



Returns NULL if two expressions are equal. Otherwise return expr1. They must have the same data type.

Syntax

NULLIF(<expr1>, <expr2>)

Examples

SELECT NULLIF(0, NULL); ┌─────────────────┐ │ nullif(0, null) │ ├─────────────────┤ │ 0 │ └─────────────────┘

Was this page helpful?