ITeye博客

mysql text, timestamp datatype 相关笔记

luolonghao · 2009-02-03 19:11 · Markdown

  1. create table时,blob, text类型不能有default value。 以下SQL会报警告。
create table ( a text not null default '');
  1. 第一个字段为timestamp not null时,default值为current_timestamp。第二个字段开始 default为0。

  2. 一个表里只能用一个default current_timestamp, on update current_timestamp。 以下SQL会报错。

create table ( a timestamp not null, b timestamp not null default current_timestamp);

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。