In MySQL I would like to round numbers down to the nearest ten.
e.g. 812 -> 810, but also 819 -> 810
Using the ROUND function does not do the trick.
I would divide by 10, do a floor() then multiply by 10 to get the proper int value. So in MySQL something like that :
SELECT FLOOR(Myattribute / 10) * 10;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With