• Login

DataSoft Corporation

NULLIF (exp1, exp2)

NULLIF returns exp1 if the two expressions are not equivalent. If the expressions are equivalent, NULLIF returns a NULL value.

Since the second row contains the NULL value, 'foo' is substituted in its place.

SELECT IFNULL(col1, 'foo') FROM Demo

This results in three rows fetched from one column:

"abc"

"foo"

"xyz"

3 rows fetched from 1 column.

The first row contains ‘abc,’ which matches the second argument of the following NULLIF call.

SELECT NULLIF(col1, 'abc') FROM Demo

A NULL is returned in its place:

<Null>

<Null>

"xyz"

Thursday, 18 April 2019 Posted in Logical Functions
 DataSoft Store  Knowledgebase  Contact Us
 Sitemap  Privacy Policy
    Customer Service


Copyright © 2019 DataSoft Corporation All rights reserved.