MINUS 是一个 SQL 集合操作,它从第一个表中选择元素,然后删除 Oracle 中第二个 SELECT 语句也返回的行.而在 SQL Server 中,我们可以使用 EXCEPT 来做同样的事情.
MINUS is a SQL set operation that selects elements from the first table and then removes rows that are also returned by the second SELECT statement in Oracle. And in SQL Server, we can use EXCEPT to do same thing.
在将我的项目从 oracle 迁移到 SQL Server 时,我注意到了不同之处.如果第一个结果集没有记录,则减去第二个 SELECT 语句的结果集.但在 SQL Server 中,EXCEPT 不返回任何内容.在这种情况下我能做什么?我正在迁移我的项目并希望在 SQL Server 中执行相同的减号功能.
While migrating my project from oracle to SQL Server, I noticed a difference. If first result set doesn't have records, minus brings result set of second SELECT Statement. But in SQL Server, EXCEPT returns nothing. What can I do in that case? I am migrating my project and want to do same of minus function in SQL Server.
感谢您的帮助
Oracle MINUS 和 SQL Server EXCEPT 没有区别.
There is no difference between Oracle MINUS and SQL Server EXCEPT.
他们打算做同样的事情.
They are intended to do the same thing.
这篇关于ORACLE/SQL Server 中的减法与除外差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!