For the complete documentation index, see llms.txt. This page is also available as Markdown.

Control Flow Functions

Learn about control flow functions in MariaDB Server. This section details SQL functions like IF, CASE, and NULLIF, which enable conditional logic within your queries and stored routines.

Implement conditional logic in SQL queries. This operator evaluates conditions and returns a specific value when the first true condition is met.

Compare a value against a list of conditions. This Oracle-compatible function returns a corresponding result when a match is found, or a default value otherwise.

Complete IF() function reference: IF(expr1,expr2,expr3) conditional syntax, TRUE/NULL evaluation rules, return type context (numeric/string), and examples.

Replace NULL values with a fallback. This function returns the first argument if it's not NULL; otherwise, it returns the specified replacement value.

Compare two expressions and return NULL if they are equal. If the expressions differ, the function returns the first expression.

Synonym for IFNULL. This Oracle-compatible function returns the first argument if it is not NULL, or the second argument if the first is NULL.

Return values based on NULL status. This function returns the second argument if the first is not NULL, and the third argument if the first is NULL.

This page is licensed: CC BY-SA / Gnu FDL

Last updated

Was this helpful?