Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

CEILING

Example

Provide the smallest whole number that is equal to or greater than a given number.

SELECT CEILING(25.75AS CeilValue;

Definition and Usage

The CEILING() function outputs the smallest integer greater than or equal to a given number.

Tip: For related functionality, consider exploring the FLOOR() and ROUND() functions as well.

Syntax

CEILING(number)

Parameter Values

Parameter

Description

number

Necessary. A numerical value.

Technical Details

Works in:

Available in SQL Server from 2008 onward, as well as in Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse.

More Examples

Example

Provide the smallest whole number that is equal to or greater than a given number.

SELECT CEILING(25AS CeilValue;

Example

Provide the smallest integer that is equal to or greater than a given number.

SELECT CEILING(-13.5AS CeilValue;