'datetype'에 해당되는 글 1건

  1. 2010.07.07 [MySQL] converting formats

[MySQL] converting formats

DB 2010. 7. 7. 20:31
시간포맷바꾸기
select date_format(now(), '%Y%m%d') from dual;

포맷바꾸기
select convert(now(), char(16)) from dual;

select cast(now() as char(16)) as now from dual;

convert의 type으로는
binary(n)
char(n)
date
datetime
decimal()
signed
time
unsigned
이 있다.

cast의 type도 마찬가지.

Posted by zeide
,