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