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

Using TO_CHAR to format DATE values - Oracle Database Tutorial

From the course: Oracle Database 12c: Basic SQL

Start my 1-month free trial

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…

Contents