The FLOOR() function in SQL rounds down the specified number. Usage syntax: FLOOR(
).
Usage of FLOOR() function in SQL
FLOOR() function is used to round down, that is, Rounds the specified number down to the nearest integer.
Syntax
<code>FLOOR(<数字>)</code>
Where:
<Number>
: The number to be rounded. Usage
The usage of the FLOOR() function is very simple. Just pass the number you want to round as an argument to the function.
Example
The following example shows the usage of the FLOOR() function:
<code class="sql">-- 取整数字 12.34 SELECT FLOOR(12.34); -- 返回 12 -- 取整浮点数 10.5 SELECT FLOOR(10.5); -- 返回 10 -- 取整负数 -12.34 SELECT FLOOR(-12.34); -- 返回 -13</code>
Notes
The above is the detailed content of Usage of floor in sql. For more information, please follow other related articles on the PHP Chinese website!