Returns the first non-NULL expression from a list of expressions. coalesce() and ifnull() are aliases.
firstnonnull ( expression [,...] ) ifnull ( expression [,...] ) coalesce ( expression [,...] )
expression | All expressions must be of the same datatype. |
Returns the first non-NULL expression from a list of expressions. The function takes arguments of any datatype, but they must be all of the same datatype. The function returns the same datatype as its argument.
firstnonnull (NULL, NULL, 'examplestring', 'teststring', NULL) returns 'examplestring'.