ceiling

Description

Returns the smallest integer greater than or equal to the specified value.

Syntax

ceiling(value)

Parameters

value

is a column, variable, or expression whose datatype is exact numeric, approximate numeric, money, or any type that can be implicitly converted to one of these types.

Examples

Example 1

select ceiling(123.45)

124 

Example 2

select ceiling(-123.45)

-123 

Example 3

select ceiling(1.2345E2)

24.000000

Example 4

select ceiling(-1.2345E2)

-123.000000

Example 5

select ceiling($123.45)

124.00 

Example 6

select discount, ceiling(discount) from salesdetail where title_id = "PS3333"

discount                                  
 -------------------- -------------------- 
            45.000000            45.000000 
            46.700000            47.000000 
            46.700000            47.000000 
            50.000000            50.000000 

Usage

Standards

SQL92 – Compliance level: Transact-SQL extension.

Permissions

Any user can execute ceiling.

See also

Command set

Functions abs, floor, round, sign