位置:首頁 > 數據庫 > MySQL教學 > MySQL least()函數

MySQL least()函數

LEAST(N1,N2,N3,N4,......)

LEAST()函數是GREATEST()函數的相反函數。其目的是為了從列表值返回至少值項(N1,N2,N3,等等)。下麵的例子顯示了LEAST()函數適當的使用和輸出:

mysql>SELECT LEAST(3,5,1,8,33,99,34,55,67,43);
+---------------------------------------------------------+
| LEAST(3,5,1,8,33,99,34,55,67,43)                        |
+---------------------------------------------------------+
| 1                                                       |
+---------------------------------------------------------+
1 row in set (0.00 sec)