Overview of Control Flow Functions

Name

Description

CASE

CASE WHEN statement is used to calculate a list of conditions and return one of multiple possible result expressions

IF()

IF(expr1,expr2,expr3), when expr1 is TRUE, it returns expr2; otherwise, it returns expr3

IFNULL()

IFNULL(expr1,expr2), when expr1 is not NULL, it returns expr1; otherwise it returns expr2

NULLIF()

NULLIF(expr1,expr2), when expr1 = expr2, returns NULL; otherwise, returns the value of expr1