SQL GREATEST()函数
GREATEST(n1,n2,n3,..........)
GREATEST()函数返回在该组输入参数(N1,N2,N3,等等)的最大值。 下面的示例使用GREATEST()函数从一组数字值返回最大值:
SQL>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)