SqlExpression COALESCE
From Eigenpedia
Contents |
Syntax
COALESCE( list of n expressions )
Purpose
Returns the first non-null argument from a list of arguments. Takes in a list of expressions which must be of the same type
Input
- list of n expressions which must all be of the same type
Output
- returns the first non-null argument of the same datatype as inputs
Example
| Function | Result |
|---|---|
| COALESCE(null, 'sdf', 'werewr') | sdf |
| COALESCE(2) | 2 |
| COALESCE(null, null, cast(null as integer), null, null) | |
| COALESCE(null, null, 2345.3245, null, null, null) | 2345.3245 |

