SqlExpression COALESCE

From Eigenpedia

Jump to: navigation, search

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



Return to Built in Function details

Personal tools