Mysql에서 자주 사용하는 TimeStamp는 날짜, 혹은 시간을 나타내는 컬럼이다.
Mysql의 Tiemstamp관련 문서다.
http://dev.mysql.com/doc/refman/5.0/en/timestamp.html
TIMESTAMP
columns are NOT NULL
by default, cannot contain NULL
values, and assigning NULL
assigns the current timestamp. However, a TIMESTAMP
column can be permitted to contain NULL
by declaring it with the NULL
attribute. In this case, the default value also becomes NULL
unless overridden with a DEFAULT
clause that specifies a different default value. DEFAULT NULL
can be used to explicitly specify NULL
as the default value. (For a TIMESTAMP
column not declared with the NULL
attribute, DEFAULT NULL
is illegal.) If a TIMESTAMP
column permits NULL
values, assigning NULL
sets it to NULL
, not to the current timestamp.위에서 읽어 볼 수 있는데 TIMESTAMP의 기본 설정이 NOT NULL이고 NULL 값을 할당(assign)하면 current timestamp(현재 시간)이 update된다.
개념없어 몰랐던 내용인데 혹시 궁금한 사람이 있을까 해서 적어 놓는다.
'DB > Mysql' 카테고리의 다른 글
Mysql purge lag (0) | 2011.10.26 |
---|---|
mysql replication 문제 (update replication 실패) (0) | 2011.09.08 |
Mysql 서브쿼리 사용법 페이지 (0) | 2011.07.01 |
Mysql index에 대해서 (0) | 2011.06.23 |
mysql insert 속도에 대하여 (Speed of INSERT Statements) (0) | 2011.04.19 |