2009年9月9日 星期三

Oracle日期轉換技巧

The TO_CHAR function converts a date value to character representations. You can use it within SQL statements or PL/SQL modules to present date values in more useful formats. The syntax of the TO_CHAR function used to format date values is shown here:

TO_CHAR(date_value, 'format mask')

The format mask specifies the format of the date when it is returned by the function. You can specify the output format any way you want by using valid date format models.

EX:
轉成何種格式的日期以下列是用TO_CHAR的使用方法:

TO_CHAR(欄位名稱,'YYYY/MM/DD')

沒有留言: