如何将不同记录从表A插入表B(两个表具有相同的结构)
我只想将不同记录从表“A”插入到表“B”。假设两个表具有相同的结构。
I want to insert only Distinct Records from Table "A" to Table "B". Assume both the tables has same structure.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果
DISTINCT
是指 TableB 上尚未存在于 TableA 中的唯一记录,则执行以下操作:If by
DISTINCT
you mean unique records that are on TableB that aren't already in TableA, then do the following:您可能不希望表的 id 列成为唯一检查的一部分,因此如果是这种情况,请使用此解决方案: https:// /stackoverflow.com/a/5171345/453673
You might not want the id column of the table to be part of the distinct check, so use this solution if that's the case: https://stackoverflow.com/a/5171345/453673