sql server 2005向上取整函数是什么或怎样实现该功能,谢谢!

解决方案 »

  1.   

    CEILING
    返回大于或等于所给数字表达式的最小整数。语法
    CEILING ( numeric_expression ) 参数
    numeric_expression是精确数字或近似数字数据类型类别的表达式(bit 数据类型除外)。返回类型
    返回与 numeric_expression 相同的类型。示例
    下面的示例显示使用 CEILING 函数的正数、负数和零值。 SELECT CEILING($123.45), CEILING($-123.45), CEILING($0.0)
    GO下面是结果集:--------- --------- ------------------------- 
    124.00    -123.00    0.00                     (1 row(s) affected)
      

  2.   

    CEILING
    返回大于或等于所给数字表达式的最小整数。语法
    CEILING ( numeric_expression ) 参数
    numeric_expression是精确数字或近似数字数据类型类别的表达式(bit 数据类型除外)。返回类型
    返回与 numeric_expression 相同的类型。
      

  3.   


    select ceiling(3.4 )
    ---------------------------------------
    4(1 行受影响)
      

  4.   


    ( numeric_expression ) 
     Arguments
    numeric_expression 
    An expression of the exact numeric or approximate numeric data type categories, or types that is implicitly convertible to float (except for the bit data type).Return Value
    Returns the same type as numeric_expression except for the following expressions. Specified expression  Return type  
    tinyint, smallint
     int
     
    real/float
     float
     
    Nonnumeric types that can be implicitly converted to float
     float
     Example
    This example uses the CEILING (SQL Server Mobile) function to round off the unit price for products that are priced more than 100 dollars.  Copy Code 
    SELECT OrderID, UnitPrice, CEILING (UnitPrice) AS "CEILING"
    FROM "Order Details"
    WHERE UnitPrice > 100
    ORDER BY UnitPrice
     
      

  5.   


    select ceiling(1.1)/*---------------------------------------
    2(1 row(s) affected)