Jump to: navigation, search

Mysql CEILING

From w3cyberlearnings

Contents

MySQL CEILING Function

This function returns the smallest value integer not less than X, and it is equal to the CEIL() function.

Syntax CEILING

X is a value to round.

CEILING(X);

Example 1

mysql> SELECT CEILING(2.5);
+-----------+
| CEILING(2.5) |
+-----------+
|         3 |
+-----------+
1 row in set (0.00 sec)

Example 2

mysql> SELECT CEILING(2.2);
+-----------+
| CEILING(2.2) |
+-----------+
|         3 |
+-----------+
1 row in set (0.00 sec)


Example 3

mysql> SELECT CEILING(-2.2);
+------------+
| CEILING(-2.2) |
+------------+
|         -2 |
+------------+
1 row in set (0.00 sec)

Related Links


Navigation
Web
SQL
MISC
References