Reputation:
I want to get the minimum of a list of numbers in MYSQL
select min(1,9,20,..);
is this possible?
Upvotes: 4
Views: 2722
Reputation: 65537
The function you are looking for is called LEAST()
:
select least(2,4,6,8,1,2,3,4) as result;
+--------+
| result |
+--------+
| 1 |
+--------+
Upvotes: 16
Reputation: 9784
Yes it is possible
SELECT MIN( mark ) FROM `student`
given that you have a student table with a mark column in it.
or use Least as posted by @Ike Walker
Upvotes: 1