Home >Database >Mysql Tutorial >mysql ceil() /ceiling()函数实例

mysql ceil() /ceiling()函数实例

WBOY
WBOYOriginal
2016-06-01 09:56:591918browse

比如有一个数5.45,我们要对5.45进行向上取整,即不管后面小数点是什么数字,均为6,此时可以使用mysql的ceil()函数。

<code class="language-sql">mysql> SELECT CEILING(5.45);
       6</code>

再看一个负数的实例:

<code class="language-sql">mysql> SELECT CEIL(-6.43);
       -6</code>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn