From the course: Oracle Database 12c: Basic SQL
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Using ROUND - Oracle Database Tutorial
From the course: Oracle Database 12c: Basic SQL
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.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Introduction to functions1m 39s
-
(Locked)
Using SUBSTRING, LENGTH, and CONCAT2m 50s
-
(Locked)
Using LENGTH1m 4s
-
(Locked)
Using CONCAT4m 48s
-
(Locked)
Using LOWER and UPPER2m 44s
-
(Locked)
Using INSTR4m 32s
-
(Locked)
Using RPAD and LPAD3m 31s
-
(Locked)
Using TO_CHAR to convert numbers1m 34s
-
(Locked)
Using TO_CHAR to format DATE values2m 59s
-
(Locked)
Using TO_CHAR to filter DATE values1m 57s
-
(Locked)
The special Oracle DUAL table1m 18s
-
(Locked)
Using ROUND1m 15s
-
(Locked)
Using TRUNC1m 36s
-
(Locked)
Using SYSDATE1m 59s
-
(Locked)
Using SYSTIMESTAMP1m 37s
-
(Locked)
Using MONTHS_BETWEEN3m 2s
-
(Locked)
Using ADD_MONTHS1m 17s
-
-
-
-
-
-