0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ORACLEのクエリのDATE型に任意の日本語の書式を含める場合:”で囲む

Last updated at Posted at 2021-05-09

やりたいこと

例えば Oracleの TO_CHAR() 関数でDATE型の値を任意の日本語の書式、例えば YY年MM月 などに変換したいです。

方法

場合には以下のように任意の日本語の書式部分の " で囲みます

NG:エラーになります
TO_CHAR(HOGE_DATE, 'YY年MM月DD日')
OK
TO_CHAR(HOGE_DATE, 'YY"年"MM"月"DD"日"')

もしも任意の書式を使っていなければエラーにはなりません

OK
TO_CHAR(HOGE_DATE, 'YY-MM-DD')
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?