Conditional Expressions
Execute logic-based operations based on specified conditions.
CASE
SYNTAX - CASE
WHEN condition1 THEN result1
[WHEN condition2 THEN result2 ]
[WHEN ......]
[ELSE default ]
END> select col1,
case
when col1 < 0 then 'res1'
when col1 > 0 then 'res2'
else 'res3'
end as result
from tableCOALESCE
coalesce(val1, val2, val3 ......)> select coalesce(NULL,20,NULL,NULL,'String1');
20NULLIF( value1, value2 )
GREATEST( <expr1>, <expr2>, <expr3>......<exprN> )
LEAST( <expr1>, <expr2>, <expr3>......<exprN> )
IS [NOT] NULL( <expr> )
NVL( <expr1>, <expr2> )
NVL2 ( <expr1>, <expr2>, <expr3> )
DECODE( <expr> , <search_1> , <result_1> [ , <search_2> , <result_2> ... ] [ , <default>] )
Last updated
