oracle에서 현재 날짜,시간 나타내기

SELECT sysdate from dual;    현재 시간은 sysdate 이고  dual 은 oracle에서 제공하는 빈 테이블.


to_char  number 형을 char형으로 변형 , date 형을 char형으로 변형  

                                       select to_char (sysdate) from dual;

to_date char형을 date형으로 변형                                               

  select to_date( to_char (sysdate))from dual;


to_number char형을 number로 변형                                            

                                              select to_number ( to_char (sysdate))from dual;


sysdate 를 format 변형하여 출력 


SELECT to_char(sysdate,'RR/MM/DD') FROM dual;      현재 날짜를 년/월/일 형태로 출력.

'개발자 > Oracle' 카테고리의 다른 글

Oracle구조  (0) 2013.01.26
Advanced Query ( Aggregation )  (0) 2013.01.26
Table Join Type  (0) 2013.01.26
Basic Query  (0) 2013.01.24
DML,DDL,CDL,TCL,Null  (0) 2013.01.24
블로그 이미지

김진리

,