用current_timestamp,不過這個默認值只用在timestamp的列,對datetime列無效
例子:
create table default_time (
id int not null primary key auto_increment,
name varchar(20) default 'chenlb',
my_time timestamp default current_timestamp
);
注意:一個表只能有一個timestamp列的默認值為當前日期時間。
posted on 2007-07-08 21:29
流浪汗 閱讀(6126)
評論(2) 編輯 收藏 所屬分類:
MySQL