ROUND
CaupolicanDiaz142 total contributions
Published Oct 7, 2022Updated Mar 25, 2023
Contribute to Docs
The ROUND
command rounds a value to the nearest integer or to a specific number of decimals if an optional value is provided.
Syntax
ROUND(value, decimal_places)
If the optional decimal_places
parameter is omitted, then the value
is rounded with zero decimals.
Example
The example below assumes there is a grades
table with a column test_scores
with values for all the exams administered in a semester, rounded to two decimal places:
SELECT names,ROUND(AVG(test_scores), 2) AS semester_avgFROM gradesGROUP BY names;
All contributors
- CaupolicanDiaz142 total contributions
- Anonymous contributorAnonymous contributor95 total contributions
- CaupolicanDiaz
- Anonymous contributor
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.