SQL Server,总是四舍五入

时间:2011-02-21 04:26:01

标签: sql-server sql-server-2005 tsql

我需要始终在SQL Server TSQL中进行汇总,这样我才能拥有Given并需要返回Needed Result

Given         Needed Result
-----------   --------------
25            25
25.1          26
25.001        26
12            12
0.1            1
0.001          1
0              0

1 个答案:

答案 0 :(得分:10)

CEILING(Given)应该做的伎俩。

Ceiling只是将给定数字舍入到下一个整数。