설문조사
PostgreSQL/PPAS 관련 듣고 싶은 교육은


총 게시물 94건, 최근 0 건
   

DATE_PART 함수를 이용한 날짜의 부분값 추출

글쓴이 : PostgresDBA 날짜 : 2012-12-14 (금) 23:52 조회 : 7281
scott@[local]:5432 scottdb#SQL> 
select 
date_part('month',now()),  date_part('day',now()),  
date_part('hour',now()), date_part('minute',now()), date_part('second',now());

 date_part | date_part | date_part | date_part | date_part 
-----------+-----------+-----------+-----------+-----------
        12 |        14 |        23 |        50 | 48.195204
(1 row)

Time: 0.329 ms
scott@[local]:5432 scottdb#SQL> 

오라클의 TO_CHAR(SYSDATE,'DD') 류의 사용과 비슷하다는것 알수 있습니다.

   

postgresdba.com