Class Coalesce
- Namespace
- YndigoBlue.Velocity.Functions
- Assembly
- YndigoBlue.Velocity.dll
Represents the COALESCE function that returns the first non-null value from a list of expressions.
public class Coalesce : Function, IElement, ICheckItem, IDefaultItem, IFilterItem
- Inheritance
-
Coalesce
- Implements
Remarks
The COALESCE function evaluates arguments from left to right and returns the first non-null value. If all arguments are null, COALESCE returns null. This is useful for providing default values, handling optional data, or consolidating values from multiple nullable columns. For example, COALESCE(col1, col2, 'N/A') returns col1 if not null, otherwise col2 if not null, otherwise 'N/A'.
Constructors
- Coalesce(IEnumerable<IElement>)
Initializes a new instance of COALESCE with a collection of elements.
- Coalesce(params IElement[])
Initializes a new instance of COALESCE with a variable number of elements.