bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL IFNULL() Function

Example

SELECT IFNULL(NULL, "ExampleSite.com");

Definition and Usage

The IFNULL() function returns a specified value if the expression is NULL.

If the expression is NOT NULL, this function returns the expression.

Syntax

IFNULL(
expression
,
alt_value
)

Parameter Values

ParameterDescription
expressionRequired. The expression to test whether is NULL
alt_valueRequired. The value to return if expression is NULL

Technical Details

Works in:From MySQL 4.0

Previous

MySQL IF() Function

Next

MySQL ISNULL() Function