mysql 追加update_time、create_time、id三字段
2017-11-26 13:20
1141 查看
紧当数据创建时设置值
alter table tbl_books modify create_time datetime not null default current_timestamp
当数据被修改时该字段自动更新
alter table tableName add update_time datetime not null default current_timestamp on update current_timestamp
修改主键自动增加
alter table tbl_books modify id bigint auto_increment
相关文章推荐
- MySQL自动设置create_time和update_time
- mysql日期字段类型---如何保存create_time和update_time
- MySQL 5.7 Invalid default value for 'CREATE_TIME'报错的解决方法
- MySQL 5.7 Invalid default value for 'CREATE_TIME'报
- mysql中在表中insert数据时,有重复主键id时,变成update
- mysql获取数据库表最后更新时间,update_time 为null (update_time innodb)
- Mysql 建表时报错 invalid ON UPDATE clause for 'create_date' column
- mysql把一个表的字段update成另一个表的字段根据id
- mysql把一个表的字段update成另一个表的字段根据id
- Mysql用Update追加记录
- python中Mysql的create,insert,update,fetchall,fetchone一些简单操作
- mysql获取数据库表最后更新时间,update_time 为null
- MySQL--操作简记(create创建操纵表、insert插入、update更新、delete删除数据)
- MySQL中详细update (on duplicate key update id=values(id),value=values(value)......)
- mysql中如何取得通过insert插入或者update修改之后的id
- mysql 表设计时的update_time自动更新
- mysql常用操作之create、update、drop、truncate等
- MySQL中详细update (on duplicate key update id=values(id),value=values(value)......) (转)
- MySQL中删除id为最小的数据
- MYSQL删除表的记录后如何使ID从1开始