To_Char Function Examples

Example 1

PL/SQL queryResult
select to_char(5399.87, '9999.9') from dual; 5399.9
select to_char(5399.87, '$9,999.00') from dual; $5,399.87




Example 2

PL/SQL queryResult
select to_char(sysdate, 'yyyy/mm/dd') from dual; 2011/11/06
select to_char(sysdate, 'Month DD, YYYY') from dual; November 06, 2011
select to_char(sysdate, 'FMMonth DD, YYYY') from dual; November 6, 2011
select to_char(sysdate, 'MON DDth, YYYY') from dual; NOV 06TH, 2011