CEILING() — Returns the smallest integer value greater than or equal to a numeric expression.
CEILING( numeric-expression )
The CEILING() function returns the next integer greater than or equal to the specified numeric expression. In other words, the CEILING() function "rounds up" numeric values. For example:
CEILING(3.1415) = 4 CEILING(2.0) = 2 CEILING(-5.32) = -5
The following example uses the CEILING function to calculate the shipping costs for a product based on its weight in the next whole number of pounds.
SELECT shipping.cost_per_lb * CEILING(product.weight), product.prod_id FROM product JOIN shipping ON product.prod_id=shipping.prod_id ORDER BY product.prod_id;