etc

[PostgreSQL] 날짜연산 Tip

tenn 2008. 6. 3. 15:51

오늘의 0시
select date_trunc('day', current_timestamp);

* day 혹은 year, month
** current_timestamp : 현재의 타임스탬프



6개월전의 첫날
select date_trunc('month', current_timestamp + '-6 months');









http://homepage2.nifty.com/sak/w_sak3/doc/sysbrd/psql_k16.htm