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

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

WBOY
Release: 2016-06-01 09:56:59
Original
1890 people have browsed it

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

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

再看一个负数的实例:

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template