实现批量插入,存在就更新,不存在就插入

1411次浏览 更新日期:2020-05-28 14:09:54 分类:程序交流 评论:3
create table testtb(  
id int not null primary key,  
name varchar(50),  
age int 
);  
insert into testtb(id,name,age)values(1,'bb',13);  
select * from testtb;  
insert ignore into testtb(id,name,age)values(1,'aa',13);  
select * from testtb;  
replace into testtb(id,name,age)values(1,"aa",12);  
select * from testtb;

在YZM系统中怎么表达!

我来说两句
  • yzmcms
    yzmcms 官网认证 3年前
    下一个版本yzmcms v5.7中已经实现,敬请关注
    1
    回复
  • luis
    luis 3年前
    @yzmcms 太棒了,5.7什么时候能出来
    0
    回复
  • luis
    luis 3年前
    replace into t(id, update_time) values(1, now());
    使用replace into可以实现,但是我不知道怎么在YZM系统中实现
    0
    回复
作者信息
发布见解
发内容 回顶部