xxxxxxxxxx
-- String formatting of date
SELECT TO_CHAR(my_date_column, 'Month DD, YYYY') AS custom_date_format FROM my_table;
-- Reverse this process
SELECT TO_DATE('February 14, 2024', 'Month DD, YYYY') AS original_date FROM converted_table;
-- custom number formatting
SELECT TO_CHAR(my_numeric_column, '$999,999.99') AS formatted_number FROM my_table;
-- Reverse this process
SELECT TO_NUMBER(REPLACE(formatted_number, '$', ''), '999999.99') AS original_numeric_value FROM converted_table;
xxxxxxxxxx
SELECT
FORMAT(123456.789, 'N') AS "Number",
FORMAT(123456.789, 'P') AS "Percent",
FORMAT(123456.789, 'C') AS "Currency";