Tuesday, September 29, 2009

Using the TO_CHAR Function with Numbers

TO_CHAR(number, 'format_model')

  • These are some of the format elements that you can use with the TO_CHAR function to display a number value as a character :
  • SELECT empno, TO_CHAR(sal, '$99,999.00') as Month_Hired FROM emp;

Using the TO_NUMBER and TO_DATE Functions :

Convert a character string to a number format using the TO_NUMBER function:
  • TO_NUMBER(char[, 'format_model'])
Convert a character string to a date format using the TO_DATE function:
  • TO_DATE(char[, 'format_model'])

No comments:

Post a Comment

Followers