在sql中使用Minus命令删除记录... [英] Delete records using Minus command in sql...

查看:116
本文介绍了在sql中使用Minus命令删除记录...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表,我想从一个表中删除第二个表中没有匹配记录的记录。现在问题是如何使用MINUS SQL语句删除记录?请用示例解释

I have two tables and I want to delete records from one table for which there is no matching records in second table. Now the question is How to delete records using MINUS SQL Statement? Please explain with example

表格中的DELETE

DELETE from Table1

(从表1中选择COL1)
MINUS

从表2中选择Col2)

(select COL1 from Table1
MINUS
select Col2 from Table 2)

与table2相比,Table1将有额外的记录,因此我想删除表1中的额外记录

Table1 will have extra records compared to table2 so I want to delete extra records from table 1

Vijay

推荐答案

使用除外,

从Table1中选择COL1

Excpet

从表2中选择Col2


这篇关于在sql中使用Minus命令删除记录...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆