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


총 게시물 94건, 최근 0 건
   

날짜 필드 분리

글쓴이 : PostgresDBA 날짜 : 2012-12-24 (월) 17:00 조회 : 5315
SQL> select to_number(to_char(current_timestamp,'hh24'),'99') as hr,
 to_number(to_char(current_timestamp,'mi'),'99') as min,
 to_number(to_char(current_timestamp,'ss'),'99') as sec,
 to_number(to_char(current_timestamp,'dd'),'99') as day,
 to_number(to_char(current_timestamp,'mm'),'99') as mth,
 to_number(to_char(current_timestamp,'yyyy'),'9999') as yr;
 hr | min | sec | day | mth |  yr  
----+-----+-----+-----+-----+------
 23 |  58 |  31 |  23 |  12 | 2012
(1 row)

scott@cloud-00:5432:scottdb] 
SQL> 

   

postgresdba.com