Conditional Expressions
|
Previous Top Next |
Function
|
Description
|
CASE
|
Evaluates a list of conditions and returns one of multiple possible result expressions
|
COALESCE
|
Returns the first non-NULL expression from a list
|
· | The simple CASE function compares an expression to a set of simple expressions to determine the result.
|
· | The searched CASE function evaluates a set of Boolean expressions to determine the result.
|
· | Evaluates input_expression, and then, in the order specified, evaluates input_expression = when_expression for each WHEN clause.
|
· | Returns the result_expression of the first (input_expression = when_expression) that evaluates to TRUE.
|
· | If no input_expression = when_expression evaluates to TRUE, Absolute Database returns the else_result_expression if an ELSE clause is specified, or a NULL value if no ELSE clause is specified.
|
· | Evaluates, in the order specified, Boolean_expression for each WHEN clause.
|
· | Returns result_expression of the first Boolean_expression that evaluates to TRUE.
|
· | If no Boolean_expression evaluates to TRUE, Absolute Database returns the else_result_expression if an ELSE clause is specified, or a NULL value if no ELSE clause is specified.
|
COALESCE(NULL, 34, 13) returns 34
|
COALESCE(FirstName, 'N/A') returns FirstName value if it's not null, or 'N/A' otherwise
|