キャスト・切り捨てSELECT date_trunc('hour', TIMESTAMP '2001-02-16 20:38:40'); Result: 2001-02-16 20:00:00 SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40'); Result: 2001-01-01 00:00:00 秒の小数点以下の切り捨てSELECT tm1 FROM tb1 2016-09-20 09:23:29.73666 SELECT date_trunc('second', tm1) FROM tb1; 2016-09-20 09:23:29 参考 |
|