简体   繁体   English

Oracle Sql中的“!=”和“<>”之间有什么区别吗?

[英]Is there any difference between “!=” and “<>” in Oracle Sql?

I would like to know if there are any differences in between the two not equal operators <> and != in Oracle. 我想知道在Oracle中两个not equal运算符<>!=之间是否存在任何差异。

Are there cases where they can give different results or different performance? 是否存在可以提供不同结果或不同性能的情况?

No there is no difference at all in functionality. 功能上没有任何区别。
(The same is true for all other DBMS - most of them support both styles): (对于所有其他DBMS也是如此 - 其中大多数都支持这两种样式):

Here is the current SQL reference: https://docs.oracle.com/database/121/SQLRF/conditions002.htm#CJAGAABC 以下是当前的SQL引用: https//docs.oracle.com/database/121/SQLRF/conditions002.htm#CJAGAABC

The SQL standard only defines a single operator for " not equals " and that is <> SQL标准仅为“ not equals ”定义了一个运算符,即<>

Actually, there are four forms of this operator: 实际上,这个运算符有四种形式:

<>
!=
^=

and even 乃至

¬= -- worked on some obscure platforms in the dark ages

which are the same, but treated differently when a verbatim match is required (stored outlines or cached queries). 它们是相同的,但在需要逐字匹配时(存储的轮廓或缓存的查询)处理不同。

在大学时,我们被教导“最佳实践”是在雇主工作时使用!=虽然上面的所有操作员都具有相同的功能。

According to this article, != performs faster 根据这篇文章,!=表现得更快

http://www.dba-oracle.com/t_not_equal_operator.htm http://www.dba-oracle.com/t_not_equal_operator.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM