The FLOOR function in SQL is used to round down a number or expression to the nearest integer that is less than or equal to the value. It can be used to round floating point numbers, determine date or time boundaries, round monetary values, and perform interval queries or groupings. The FLOOR function is the opposite of the CEIL function, which rounds numbers upward.
The meaning of the FLOOR function in SQL
The FLOOR function is a built-in function that is used to round down one The value of a number or expression. This means that it rounds the number to the nearest integer less than or equal to the value.
Syntax
<code>FLOOR(expression)</code>
Where:
expression
is the number or expression to be rounded. Example
<code class="sql">SELECT FLOOR(12.5); -- 结果: 12 SELECT FLOOR(-12.5); -- 结果: -13 SELECT FLOOR(12.501); -- 结果: 12</code>
Function
FLOOR function is used in various applications, such as:
Tip
The above is the detailed content of What does floor mean in sql. For more information, please follow other related articles on the PHP Chinese website!