Loading lesson path
Concept visual
Start at both ends
Round the number to 2 decimal places:
SELECT ROUND(135.375, 2);The ROUND() function rounds a number to a specified number of decimal places.
FLOOR(), CEIL(), CEILING(), and
functions.
number, decimals )
Required. The number to be rounded decimals Optional. The number of decimal places to round number to. If omitted, it returns the integer (no decimals)
From MySQL 4.0
Round the number to 0 decimal places:
SELECT ROUND(345.156,
0);Round the Price column (to 1 decimal) in the "Products" table: SELECT ProductName, Price, ROUND(Price, 1) AS RoundedPrice
FROM Products;❮ MySQL Functions