Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

IFNULL function (ODBC compatible)

Syntax

IFNULL( expr, value)

Description

The scalar function IFNULL returns value if expr is null. If expr is not null, IFNULL returns expr.

Example

select c1, ifnull(c1, 9999) from temp order by c1;

c1 ifnull(c1,9999)

9999

9999

9999

1 1

3 3

Notes

The data type of value must be compatible with the data type of expr.

TOCIndex