YouTip LogoYouTip

Mysql Func Ifnull

# MySQL IFNULL() Function [![Image 3: MySQL Functions](#) MySQL Functions](#) The IFNULL() function is used to check whether the first expression is NULL. If it is NULL, it returns the value of the second parameter; if it is not NULL, it returns the value of the first parameter. The syntax format for the IFNULL() function is: IFNULL(expression, alt_value) If the first parameter expression is NULL, it returns the alternate value of the second parameter. **Parameter Description:** | Parameter | Description | | --- | --- | | _expression_ | Required. The value to test. | | _alt_value_ | Required. The value to return if the expression is NULL. | ### Example First parameter is NULL: SELECT IFNULL(NULL, "TUTORIAL"); The output of the above example is: TUTORIAL First parameter is not NULL: SELECT IFNULL("Hello", "TUTORIAL"); The output of the above example is: Hello [![Image 4: MySQL Functions](#) MySQL Functions](#)
← Ref Set ClearC Sort Algorithm β†’