MySQL: CEILING Function

  • Post author:
  • Post category:MySQL
  • Post comments:1 Comment
MySQL CEILING Function

In this guide, we will explain how to use the MySQL CEILING function with syntax and examples.

Description

The MySQL CEILING function returns the smallest integer value that is greater than or equal to a number.

Syntax

The syntax for the CEILING function in MySQL is:

CEILING( number )

Parameters or Arguments

number

The value is used to find the smallest integer value.

Note

  • The CEIL function is a synonym for the CEILING function.
  • See also the FLOORCEILROUND, and TRUNCATE functions.

Applies To

The CEILING function can be used in the following versions :

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

Example

Let’s look at some CEILING function examples and explore how to use the CEILING function.

For example:

mysql> SELECT CEILING(32.65);
Result: 33

mysql> SELECT CEILING(32.1);
Result: 33

mysql> SELECT CEILING(32);
Result: 32

mysql> SELECT CEILING(-32.65);
Result: -32

mysql> SELECT CEILING(-32.1);
Result: -32

mysql> SELECT CEILING(-32);
Result: -32

Next Topic : Click Here

This Post Has One Comment

Leave a Reply