How to remove the decimal point of SUM in SQL: Use the ROUND() function: ROUND(SUM(expression), decimal_places) to retain 0 decimal places: ROUND(SUM(salary), 0) Round to the nearest integer ROUND () function only affects the display of query results and does not affect the data in the table. Permanently delete the decimal point: ALTER TABLE employee ALTER COLUMN salary TYPE INT
## Removed in SQL SUM decimal point
In SQL, you can remove the decimal point from the SUM calculation result by using the ROUND() function.Syntax:
<code>ROUND(SUM(expression), decimal_places)</code>
Usage example:
<code class="sql">SELECT ROUND(SUM(salary), 0) AS total_salary FROM employee;</code>
Note:
<code class="sql">ALTER TABLE employee ALTER COLUMN salary TYPE INT;</code>
The above is the detailed content of How to remove the decimal point from sum in sql. For more information, please follow other related articles on the PHP Chinese website!