Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 677 Bytes

File metadata and controls

23 lines (16 loc) · 677 Bytes
description
Compares two expressions. If the values in each expression are equal, returns NULL and, if they are not equal, returns the value of the first expression.

NULLIF

Syntax

NULLIF(expression1, expression2) → same as input type

  • expression: The expressions can be any data type, however all the expressions contained in the argument must be of the same type.

Examples

{% code title="NULLIF example" %}

SELECT NULLIF(user_id, customer_id)

-- user_id

{% endcode %}