ORACLE/SQL Server 中的减法与除外差异

Minus vs Except Difference in ORACLE/SQL Server(ORACLE/SQL Server 中的减法与除外差异)
本文介绍了ORACLE/SQL Server 中的减法与除外差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

  • http://dotnetguts.blogspot.com/2008/04/minus-keyword-in-sql-server.html
  • http://blog.sqlauthority.com/2008/08/07/sql-server-except-clause-in-sql-server-is-similar-to-minus-clause-in-oracle/
  • http://vyaskn.tripod.com/oracle_sql_server_differences_equivalents.htm(搜索 MINUS 运算符),阅读说明, 完全匹配 SQL Server 的 EXCEPT)
  • Oracle MINUS 与 SQL Server 除外(比较文档)
  • http://dotnetguts.blogspot.com/2008/04/minus-keyword-in-sql-server.html
  • http://blog.sqlauthority.com/2008/08/07/sql-server-except-clause-in-sql-server-is-similar-to-minus-clause-in-oracle/
  • http://vyaskn.tripod.com/oracle_sql_server_differences_equivalents.htm (search for MINUS operator), read the description, which matches EXCEPT for SQL Server exactly)
  • Oracle MINUS vs SQL Server EXCEPT (compare docs)

这篇关于ORACLE/SQL Server 中的减法与除外差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
SSIS: Model design issue causing duplications - can two fact tables be connected?(SSIS:模型设计问题导致重复-两个事实表可以连接吗?)
SQL to Generate Periodic Snapshots from Transactions Table(用于从事务表生成定期快照的SQL)
SQL Server Graph Database - shortest path using multiple edge types(SQL Server图形数据库-使用多种边类型的最短路径)
Invalid column name when using EF Core filtered includes(使用EF核心过滤包括时无效的列名)
How should make faster SQL Server filtering procedure with many parameters(如何让多参数的SQL Server过滤程序更快)