Declaration
MIN([DISTINCT | ALL] expr)
Description
Returns the minimum value in the specified data.
The value of MIN() can be a string parameter, and the result returns the minimum string value. The DISTINCT keyword indicates that only distinct values are counted; the default is ALL.
Examples
Assume table a contains three rows of data: id=1,num=10, id=2,num=20, and id=3,num=30. Find the minimum value of num among them:
obclient> SELECT MIN(num) FROM a;
+----------------+
| MIN(num) |
+----------------+
| 10 |
+----------------+
1 row in set