Is there a built-in function or some other way to limit the value of numbers in MySQL?
For example, let’s say I have a table with the following rows:
score
=====
5
10
20
50
3
15
I’d looking for some type of query along the lines of…
SELECT NUMBER_LIMITER(score, 10) FROM ScoresTable
…which would return the following result…
score
=====
5
10
10
10
3
10
If not, I’ll write a function. Just hoping there might be something built-in as performance is quite important for this project. Thanks!
http://dev.mysql.com/doc/refman/5.5/en/comparison-operators.html#function_least