The following expression returns expr2 if expr1 is NULL, and expr1 otherwise: : IFNULL « Function « SQL / MySQL






The following expression returns expr2 if expr1 is NULL, and expr1 otherwise:

      


IFNULL(expr1, expr2) corresponds to IF(ISNULL(expr1), expr2, expr1)

   
    
    
    
    
    
  








Related examples in the same category

1.The IFNULL() function returns a value based on whether a specified expression evaluates to NULL.
2.IFNULL() tests its first argument and returns it if it's not NULL, or returns its second argument otherwise
3.IF( ) and IFNULL( ) are useful for catching divide-by-zero operations
4.Use IFNULL( ) to map their results appropriately:
5.IFNULL() takes two arguments. If the first argument is not NULL, that argument is returned; otherwise, the fun
6.SELECT ISNULL(NULL), ISNULL(0), ISNULL(1);