From the course: Oracle Database 12c: Basic SQL

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Using ROUND

Using ROUND

- [Instructor] The Round SQL function allows us to round off digits following the decimal point of a number returned by a SQL query. Let's see it in action. Let's type select, and let's enter a constant value for our example this time. So I'll type 999.98765, from dual. Running the query as-is will return our constant value as-is. However, I can add the Round function, and inside brackets specifying the actual number, but this can also be value retrieved from a database table, comma, any number of digits I want to round to following the decimal point. So let's start with three. Let's run this query again, and as you see, the number was rounded to 999.988. Changing three to one will round the value completely, and changing one to two will round the value to two decimal points, so 999.99.

Contents