Contents Index NOW function [Date and time] NUMBER function [Miscellaneous]

ASA SQL Reference
  SQL Functions
    Alphabetical list of functions

NULLIF function [Miscellaneous]


Function 

To provide an abbreviated CASE expression by comparing expressions.

Syntax 

NULLIF ( expression-1expression-2 )

Parameters 

expression-1    An expression to be compared.

expression-2    An expression to be compared.

Usage 

NULLIF compares the values of the two expressions.

If the first expression equals the second expression, NULLIF returns NULL.

If the first expression does not equal the second expression, or if the second expression is NULL, NULLIF returns the first expression.

The NULLIF function provides a short way to write some CASE expressions.

Standards and compatibility 
See also 

CASE expressions

Example 

The following statement returns the value a:

SELECT NULLIF( 'a', 'b' )

The following statement returns NULL.

SELECT NULLIF( 'a', 'a' )

Contents Index NOW function [Date and time] NUMBER function [Miscellaneous]