NULLIF function (SQL)

Help Contents

Introduction

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

Syntax

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

Remarks

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.

Examples

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.

Glossary

For the meaning of terms used in Fernhill SCADA.