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 convert numbers - Oracle Database Tutorial
From the course: Oracle Database 12c: Basic SQL
Using TO_CHAR to convert numbers
- [Instructor] We can use the TO_CHAR function to convert a number into a string and give it a specific format. So for example, if I'll type SELECT TO_CHAR, salary, which is the salary column from my employees table and specify the following format string as the second argument for my TO_CHAR function, the output of data from my table will look as follows. Note that using this format string formatted the number output into a more readable string representation of that number that better represents salaries. That's because the L character you see here represents local currency as configured in my database. And the combination of numbers and letters represent the formatting mask on how to format the data returned from the database. Note what happens if I remove the L character and run my query again. I still got my numbers formatted as strings but without the currency symbol. Note the difference between this method of formatting numbers to be displayed as part of my single query and…
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
-
-
-
-
-
-