Flash cards
Review the key moves
1/4
Core idea
What is the main idea behind SQL Server ROUND() Function?
Lesson checks
Practice each idea before moving on
Short Mimo-style checks built from this lesson's code, terms, and sequence.
1Quick choice
Which statement best captures the main point of this lesson?
2Fill blank
Complete the missing token from the example code.
___ ROUND(235.415, 2) AS RoundValue;3Order
Put the learning moves in the order that makes the concept easiest to apply.
The ROUND() function rounds a number to a specified number of decimal places.
Definition and Usage
SQL Server ROUND() Function
Example
SELECT ROUND(235.415, 2) AS RoundValue;Definition and Usage
The ROUND() function rounds a number to a specified number of decimal places.
Tip
Also look at the FLOOR() and CEILING() functions.
Syntax
ROUND(
number
,
decimals
,
operation
)Parameter Values
| Parameter | Description |
|---|---|
| number | Required. The number to be rounded |
| decimals | Required. The number of decimal places to round number to |
| operation | Optional. If 0, it rounds the result to the number of decimal . If another value than 0, it truncates the result to the number of decimals. Default value is 0 |
Technical Details
| Works in: | SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse |
|---|