bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL NULLIF() Function

Example

SELECT NULLIF(25, 25);

Definition and Usage

The NULLIF() function compares two expressions and returns NULL if they are equal. Otherwise, the first expression is returned.

Syntax

NULLIF(
expr1
,
expr2
)

Parameter Values

ParameterDescription
expr1, expr2Required. The two expressions to be compared

Technical Details

Works in:From MySQL 4.0

Previous

MySQL LAST_INSERT_ID() Function

Next

MySQL SESSION_USER() Function