Round Syntax:
SELECT ROUND(column_name,decimal precision)
FROM table_name
Sales table:
ID | PRICE | NAME |
---|---|---|
1 | 25.845 | A |
2 | 26.97 | B |
3 | 27.9 | C |
4 | 28.34 | D |
Round Example 1:
SELECT id, ROUND(price,1)
FROM store;
Round Result:
ID | PRICE |
---|---|
1 | 25.8 |
2 | 26.9 |
3 | 27.9 |
4 | 28.3 |
Round Example 2:
SELECT id, ROUND(price,0)
FROM store;
Round Result:
ID | PRICE |
---|---|
1 | 26 |
2 | 27 |
3 | 28 |
4 | 28 |