“<>”的 SQL 运算符名称是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15179419/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 14:00:31  来源:igfitidea点击:

What is the SQL operator name for "<>"?

sqloperators

提问by Great User

I am confused and did not find in Google. Can anyone tell me What is Sql <>operator name?

我很困惑,没有在谷歌找到。谁能告诉我Sql <>运营商名称是什么?

回答by steoleary

<>is NOT Equal to, it's the same as !=

<>不等于,等同于 !=

回答by Jon Skeet

It's "not equal". Look in the list of operators for the database you're using, and find the appropriate section (usually "comparison operators"). For example:

是“不等”。查看您正在使用的数据库的运算符列表,并找到相应的部分(通常是“比较运算符”)。例如:

回答by Woot4Moo

It is the not equalsoperator. Usage:

它是not equals运营商。用法:

select *  
from table
where foo <> 0 

回答by Pieter Geerkens

It is the Not Equal operator, but I am going to have to be verbose to get my answer posted because I haven't entered enough characters yet.

它是 Not Equal 运算符,但由于我还没有输入足够的字符,所以我将不得不冗长地发布我的答案。

回答by Dhanya Raj

<>means not equal same as !=

<>意味着不等于 !=

回答by user2804797

Checks if the values of two operands are equal or not, if values are not equal then condition becomes true. (a <> b) or (a != b) is true.

检查两个操作数的值是否相等,如果值不相等则条件为真。(a <> b) 或 (a != b) 为真。

回答by Gustavo A Garcia

Here is the answer – Technically there is no difference between != and <>. Both of them work the same way and there is absolutely no difference in terms of performance or result. If != and <> both are the same, which one should be used in SQL queries?

这是答案——从技术上讲,!= 和 <> 之间没有区别。它们的工作方式相同,在性能或结果方面绝对没有区别。如果 != 和 <> 两者相同,那么在 SQL 查询中应该使用哪一个?

You can use either != or <> both in your queries as both technically same but I prefer to use <> as that is SQL-92 standard.

您可以在查询中使用 != 或 <> ,因为两者在技术上是相同的,但我更喜欢使用 <> ,因为这是 SQL-92 标准。