位置:首頁 > 數據庫 > SQL教學 > SQL LEAST()函數

SQL LEAST()函數

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

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

SQL>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)