Home / SQL / Reference / Numbers and NULL

SQL ROUND

Round a number to a given number of decimal places.

Syntax

ROUND(number, decimals)

With no second argument it rounds to a whole number.

Example

Query (on the shop database used in the SQL course)

SELECT name, price, ROUND(price / 3, 2) AS three_payments
FROM products
LIMIT 4;

Result

namepricethree_payments
Wireless mouse29.09.67
Mechanical keyboard119.039.67
USB-C hub49.016.33
27-inch monitor329.0109.67

4 rows

Related

Learn it step by step in the free lesson Functions: Text, Numbers, Dates & CASE, with exercises that check your queries.