利用sql语句复制一条或多条记录数据库

/ / 2016-09-30   阅读:2509
insert into article (id,class,title,content) select id,'2',title,content from article where class='1'   如果id为自动编号,就把改为:   insert into article (class,title,content) select '2',...
insert into article (id,class,title,content) select id,'2',title,content from article where class='1'  

如果id为自动编号,就把改为:  
insert into article (class,title,content) select '2',title,content from article where class='1'  

如果class为数字类型,则去掉单引号.

我要评论

昵称:
验证码:

最新评论

共0条 共0页 10条/页 首页 上一页 下一页 尾页
意见反馈