【发布时间】:2016-07-21 22:38:33
【问题描述】:
我有 2 个表,table1 和 table2,每个表都添加了行 table1 = 2m 行和 table2 = 1m 行并且 table2 中的一些行已经在 table1 上,并且 table1 具有唯一值
我试试这个命令:
INSERT INTO table1 (top1, top2, top3)
SELECT top1, top2, top3 FROM table2
top1 是唯一值,如果 table2 top1 已经在 table1 top1 上,我该如何选择?
【问题讨论】:
-
什么是PK,就是top1或者top1+top2+top3
标签: sql