Conditional Expressions
Execute logic-based operations based on specified conditions.
CASE
Returns the result of the first condition evaluating to true or returns the default value if all conditions evaluate to false.
COALESCE
Returns the first non-null value from a list of expressions.
NULLIF( value1, value2 )
Returns null if value1
equals value2
, otherwise returns value1
GREATEST( <expr1>, <expr2>, <expr3>......<exprN> )
Returns the largest value among the given values.
LEAST( <expr1>, <expr2>, <expr3>......<exprN> )
Returns the smallest value among the given values.
IS [NOT] NULL( <expr> )
Returns boolean based on the expr is null or is not null
NVL( <expr1>, <expr2> )
If expr1 is NULL, returns expr2, otherwise returns expr1.
NVL2 ( <expr1>, <expr2>, <expr3> )
Returns values depending on whether the first input is NULL. If expr1 is NOT NULL, then NVL2 returns expr2.
If expr1 is NULL, then NVL2 returns expr3.
DECODE( <expr> , <search_1> , <result_1> [ , <search_2> , <result_2> ... ] [ , <default>] )
Compares each search expression sequentially against the select expression. Upon finding a match, it returns the corresponding result expression.
Last updated