首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >导入项目并仅删除旧项目

导入项目并仅删除旧项目
EN

Stack Overflow用户
提问于 2015-12-23 23:55:24
回答 1查看 28关注 0票数 0

如果MySQL表中存在项,则导入或更新。

样本进口:

代码语言:javascript
复制
Jon | 12
Marie | 17
Delia | 10
Megan | 2

在MySQL表中:

代码语言:javascript
复制
Jon | 12
chrtalie | 23

如果在Sapmle - chrtalie | 23中不存在,如何删除记录?大约有两千多个项目。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-12-31 08:35:38

我认为有两种选择:

  1. 在导入之前清除表。
  2. 将两个表导入原始表的临时副本,并手动合并两个表:
代码语言:javascript
复制
1. Create an empty copy of the original table
2. Import into the copy
3. Delete from the original table the entries that are not in the copy
4. Update the entries in the original table that are in the copy
5. Add in the original table the entries that are only in the copy
6. Drop the copy table

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34445483

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档