最后25分,求1个小数点精度问题.
2.1 ->2
2.3 ->2
2.5 ->2.5
2.6 ->2.5
2.8 ->2.5
3 ->3
即向下精确到0.5 这个怎么设?
用 ROUND(2.3, 2),CEILING(2.3)等测试好久没搞定.
------解决方案--------------------select case when txt<cast(txt as int)+0.5 then cast(txt as int) else cast(txt as int)+0.5 end from tb