摘要: insert into xxx on duplicate key update xxx=xxx语句,解决插入数据时产生的重复主键问题,前提是设置了正确的unique key。 相当于完成的操作: if not exists (select 。。。。。。) insert into 。。。。。。else 阅读全文
posted @ 2021-06-24 16:00 xuzhujack 阅读(906) 评论(2) 推荐(0) 编辑
摘要: 关于timestamp的两属性CURRENT_TIMESTAMP 和ON UPDATE CURRENT_TIMESTAMP,使用示例如下: CREATE TABLE `upload_table` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID', 阅读全文
posted @ 2021-06-24 10:13 xuzhujack 阅读(725) 评论(0) 推荐(0) 编辑
;