The result is the integer part of the calculated value in the same data type as numeric expression.
Floor value in sql.
The sql floor function is a mathematical function used to return the closest integer value which is less than or equal to the specified expression or value.
In sql server transact sql the floor function returns the largest integer value that is equal to or less than a number.
Syntax of sql floor function.
Sql distinct along with the sql floor function is used to retrieve only unique value after rounded down to the next least integer value depending on the column specified.
Also look at the ceiling and round functions.
The basic syntax of the sql server floor function is.
It also accepts one value.
The sql floor function rounded up any positive or negative decimal value down to the next least integer value.
It returns the largest smallest integer greater than or equal to the specified numeric expression.
Select floor 123 45 floor 123 45 floor 123 45.
Select floor numeric expression from source.
The following example shows positive numeric negative numeric and values with the floor function.