Back to Developer Roadmap

CEILING

src/data/roadmaps/sql/content/[email protected]

4.0676 B
Original Source

CEILING

The CEILING() function in SQL returns the smallest integer greater than or equal to a given numeric value. It's useful when you need to round up a number to the nearest whole number, regardless of whether the number is already an integer or a decimal. For example, CEILING(4.2) would return 5, and CEILING(-4.7) would return -4. This function is commonly used in scenarios where rounding up is necessary, such as calculating the number of pages needed to display a certain number of items when each page has a fixed capacity.

Visit the following resources to learn more: