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 TO_CHAR to format DATE values - Oracle Database Tutorial
From the course: Oracle Database 12c: Basic SQL
Using TO_CHAR to format DATE values
- [Instructor] The Oracle TO_CHAR sequel function is especially useful when formatting how date values are displayed by our sequel query. So let's see it in action. We'll start by selecting the first name column and the hire date column of all employees in our employees table. As we can see, hire date is the value of when an employee initially joined our company. And as we can see, the format of how date values are displayed is determined by the session and database configuration. However, we can override it if we want to display date values using a different format. For example, maybe you want to see the month name before the day of the month. Or instead of seeing month names, you just want to see a number corresponding to the month. So one for January, two for February, and so on. We can accomplish all that using the TO_CHAR function. So let's see it in action. We'll type TO_CHAR, and inside brackets specify hire date, which is the column containing date values on which we want to…
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
-
-
-
-
-
-