CEILING( )

This MySQL function rounds a given floating-point number up to the next higher integer.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

CEILING(number)

Explanation

This function rounds a given floating-point number up to the next higher integer. It's an alias to CEIL(). This function can be particularly useful when you want a numeric value for a time function, but without the decimal places (the microseconds) in the results:

Examples

SELECT NOW(), NOW() + 0, CEILING(NOW() + 0);

+---------------------+-----------------------+--------------------+
| NOW()               | NOW() + 0             | CEILING(NOW() + 0) |
+---------------------+-----------------------+--------------------+
| 2007-07-16 00:07:14 | 20070716000714.000000 |     20070716000714 |
+---------------------+-----------------------+--------------------+