SQL ROUND Function


The ROUND() function is used to round a numeric field to the number of decimals specified.

Syntax

SELECT ROUND(column_name,decimals) FROM table_name;
Parameter Description
column_name Required. The field to round.
decimals Required. Specifies the number of decimals to be returned.

Example

student Table

stud_sidstud_namestud_fee
11211Ashwani200.68
11212Sachin400.45
11213Deepak600.98
11214Sanjay800
SELECT ROUND(stud_fee) FROM student;
Output
stud_sidstud_namestud_fee
11211Ashwani201
11212Sachin400
11213Deepak601
11214Sanjay800

OR

SELECT stud_id, ROUND(stud_fee) AS round_fee FROM student;
Output
stud_sidround_fee
11211201
11212400
11213601
11214800

Share this article on