The NULLIF, NVL & NVL2 SQL Functions in Saved Search.

NULLIF:

Syntax: NULLIF(expr1, expr2)

Description: Compares expr1 and expr2. If they are equal, then the function returns null. If they are not equal, then the function returns expr1.

Example: NULLIF({price}, 0)

NVL:

Syntax: NVL(expr1, expr2)

Description: Lets you replace null with the second parameter.

Example: NVL({quantity},’0′)

NVL2:

Syntax: NVL2(expr1, expr2, expr3)

Description: If expr1 is not null, then NVL2 returns expr2. If expr1 is null, then NVL2 returns expr3.

Example: NVL2({location}, 1, 2)

Leave a comment

Your email address will not be published. Required fields are marked *