diff --git a/docs/source/user-guide/sql/scalar_functions.md b/docs/source/user-guide/sql/scalar_functions.md index 4e74cfc54ae5..426835ed819d 100644 --- a/docs/source/user-guide/sql/scalar_functions.md +++ b/docs/source/user-guide/sql/scalar_functions.md @@ -549,6 +549,7 @@ trunc(numeric_expression[, decimal_places]) - [coalesce](#coalesce) - [greatest](#greatest) - [ifnull](#ifnull) +- [least](#least) - [nullif](#nullif) - [nvl](#nvl) - [nvl2](#nvl2) @@ -603,6 +604,29 @@ greatest(expression1[, ..., expression_n]) _Alias of [nvl](#nvl)._ +### `least` + +Returns the smallest value in a list of expressions. Returns _null_ if all expressions are _null_. + +``` +least(expression1[, ..., expression_n]) +``` + +#### Arguments + +- **expression1, expression_n**: Expressions to compare and return the smallest value.. Can be a constant, column, or function, and any combination of arithmetic operators. Pass as many expression arguments as necessary. + +#### Example + +```sql +> select least(4, 7, 5); ++---------------------------+ +| least(4,7,5) | ++---------------------------+ +| 4 | ++---------------------------+ +``` + ### `nullif` Returns _null_ if _expression1_ equals _expression2_; otherwise it returns _expression1_.