FLOOR
rounds to the nearest integer smaller than the input value.
To round to the nearest integer that is greater use the CEILING function.
Alternatively, use the ROUND function.
This example return the nearest integer that is smaller than the input value.
SELECT FLOOR(35.7) AS 'Floor'
Floor |
---|
35 |
Syntax of the FLOOR function.
FLOOR(value)
value
-- a number, variable, or column name.
PRODUCT |
---|
Id |
ProductName |
SupplierId |
UnitPrice |
Package |
IsDiscontinued |
SELECT ProductName, UnitPrice,
FLOOR(UnitPrice) AS Floor
FROM Product
ORDER BY UnitPrice
ProductName | UnitPrice | Floor |
---|---|---|
Geitost | 2.50 | 2 |
Guaraná Fantástica | 4.50 | 4 |
Konbu | 6.00 | 6 |
Filo Mix | 7.00 | 7 |
Tourtière | 7.45 | 7 |
Rhönbräu Klosterbier | 7.75 | 7 |