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)