LEAST
The LEAST function returns the smallest expression in a list of expressions. All expressions after the first are implicitly converted to the data type of the first expression before the comparison.
To retrieve the largest expression in a list of expressions, useGREATEST.
The data type of the first expression.
LEAST (expr[,expr]...)
-
expr
-
An expression.
Example 17-38 Finding the Shortest Text Expressions
The following statement returns the shortest string.
SHOW LEAST('Harry','Harriot','Harold')
Harry
Example 17-39 Finding the Smallest Numerical Expressions
The following statement selects the number with the smallest value.
SHOW LEAST (5, 3, 18) 3
原文地址:点击打开链接
本文介绍了LEAST函数的基本用法及示例,LEAST函数用于从一组表达式中找出最小值,所有后续表达式将隐式转换为第一个表达式的数据类型进行比较。文中还对比了与GREATEST函数的区别。
321

被折叠的 条评论
为什么被折叠?



