简体   繁体   中英

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.

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):

Here is the current SQL reference: https://docs.oracle.com/database/121/SQLRF/conditions002.htm#CJAGAABC

The SQL standard only defines a single operator for " not equals " and that is <>

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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