NULLIF function (SQL)

Help Contents


The SQL NULLIF function returns NULL if two values are equal.


primary-nullif ::=
  NULLIF ( value-expression, value-expression )


If the two values are different the function returns the first value. If the two values are the same, the function returns NULL.

The return type is the same type as the first value.

If either value is NULL, the return value is NULL.


  1. To replace empty units strings with NULL:
    Select FullName, Value, null-if( Units, '' ) AS "Units"
    From TagDataPointAnalog

Further Information

Value Expressions (SQL)

To learn more about SQL scalar value expressions.

Fernhill SCADA Structured Query Language (SQL)

To learn more about the SQL features in Fernhill SCADA.


For the meaning of terms used in Fernhill SCADA.