Table of Contents

Search

  1. About the Data Vault SQL Reference
  2. Introduction to SQL Reference for Informatica Data Vault
  3. Date and Time Arithmetic
  4. WHERE Clauses
  5. UNION Operator
  6. Parameterized Query
  7. Functions

Data Vault SQL Reference

Data Vault SQL Reference

NULLIF

NULLIF

Returns a null value if the arguments are equal, otherwise it returns the value of the first argument.

NULLIF Example

SELECT item, NULLIF(cost, -1) FROM inventory;
For this example, say that a cost value of -1 indicates no cost at all. With the .NULLS system variable set to ‘N/A’, it might be more informative to return a null value instead of -1. Using the NULLIF function, a null value can be substituted for every return of -1.
The equivalent (simple) CASE expression for this example would be the following:
SELECT item, CASE cost WHEN -1 THEN NULL ELSE cost END FROM inventory;

0 COMMENTS

We’d like to hear from you!