AdBlock Detected!
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.
SQL ROUND Function |
SQL > SQL Functions >
ROUND Function
The ROUND function in SQL is used to round a number to a specified precision. SyntaxThe syntax for the ROUND function is, ROUND (expression, [decimal place])
where [decimal place] indicates the number of decimal points returned. A negative number means the rounding will occur to a digit to the left of the decimal point. For example, -1 means the number will be rounded to the nearest tens. ExamplesWe use the following table for our examples. Table Student_Rating
and this table contains the following rows: Table Student_Rating
Example 1: Decimal place is positiveTo round to the nearest tenths place, we use the following SQL: SELECT First_Name, ROUND (Rating, 1) Rounded_Score FROM Student_Rating;
Result:
Example 2: Decimal place is negativeTo round to the nearest tens place, we use the following SQL: SELECT First_Name, ROUND (Rating, -1) Rounded_Score FROM Student_Rating;
Result:
|
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.