24
18

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 5 years have passed since last update.

【PostgreSQL】TimestampをDateに変換する

Last updated at Posted at 2017-11-01

##変換方法

###CAST演算子で変換する方法(推奨)

sql
CAST(column1 AS DATE)

※column1はTimestamp型とします。

###TO_CHARでCHAR型に変換した後、TO_DATEでDATE型に変換する方法

sql
TO_DATE(TO_CHAR(column1, 'YYYY/MM/DD'),'YYYY/MM/DD')

※column1はTimestamp型とします。

24
18
2

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
24
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?