QUESTION POSED ON: 09 April 2009
I'm hoping you can help me with a MySQL rounding issue where I have hit the
wall. I'm attempting to take an integer column, 'x', from table 'y' and
achieve the following:
If x = 0, then x = 0
If x <= 30, then x = 30
If x > 30, then round x to nearest multiple of 6.
I can do the following to round to nearest multiple of 6, but this does
not help me for values <= 30:
select ceiling(x/6)*6 from y;
Can you help?
|