This topic describes how to use the conditional function NULLIF in Realtime Compute.

Syntax

NULLIF(A,B)     

Input parameters

Parameter Data type
A INT
B INT

Description

Checks whether two specified parameters have the same value. If yes, null is returned. If not, the value of the first parameter is returned.

Example

  • Test data
    var1 (INT) var2 (INT)
    30 30
  • Test statements
    SELECT NULLIF(var1,var2) as aa
    FROM T1;                  
  • Test results
    aa (INT)
    null