Home > Database > Mysql Tutorial > mysql GREATEST()函数获取集合中最大的值

mysql GREATEST()函数获取集合中最大的值

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 09:56:57
Original
1830 people have browsed it

GREATEST(n1,n2,n3,..........)

GREATEST()函数返回输入参数(n1, n2, n3, 等)组的最大值。下面的示例使用 GREATEST()函数从一组数字值中返回最大的值:

<code class="language-sql">mysql>SELECT GREATEST(3,5,1,8,33,99,34,55,67,43);
+---------------------------------------------------------+
| GREATEST(3,5,1,8,33,99,34,55,67,43)                     |
+---------------------------------------------------------+
| 99                                                      |
+---------------------------------------------------------+
1 row in set (0.00 sec)</code>
Copy after login

住:GREATEST()函数是LEAST()函数的相反函数。 

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template