# Control Flow Functions

- [CASE OPERATOR](https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/case-operator.md): Implement conditional logic in SQL queries. This operator evaluates conditions and returns a specific value when the first true condition is met.
- [DECODE\_ORACLE](https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/decode_oracle.md): 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.
- [IF Function](https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/if-function.md): Complete IF() function reference: IF(expr1,expr2,expr3) conditional syntax, TRUE/NULL evaluation rules, return type context (numeric/string), and examples.
- [IFNULL](https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/ifnull.md): Replace NULL values with a fallback. This function returns the first argument if it's not NULL; otherwise, it returns the specified replacement value.
- [NULLIF](https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/nullif.md): Compare two expressions and return NULL if they are equal. If the expressions differ, the function returns the first expression.
- [NVL](https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/nvl.md): 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.
- [NVL2](https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions/nvl2.md): 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/sql-functions/control-flow-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
