加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sql server中的!=和<>有什么区别[重复]

发布时间:2020-12-12 06:55:52 所属栏目:MsSql教程 来源:网络整理
导读:参见英文答案 Should I use != or for not equal in T-SQL?14个答案 What is difference between operater != and in SQL Server? [duplicate]3个答案有什么区别!=和 Sql Server中的运算符? 因为两者都用作非运算符。例如: select * from TableName where
参见英文答案 > Should I use != or <> for not equal in T-SQL?14个答案> What is difference between operater != and <> in SQL Server? [duplicate]3个答案有什么区别!=和<> Sql Server中的运算符?

因为两者都用作非运算符。例如:

select * from TableName where ColName <> value

要么

select * from TableName where ColName != value

返回相同的值(行)。

解决方法

没有区别。您可以在MSSQL中使用它们。

The MSSQL doc says:

!= functions the same as the <> (Not Equal To) comparison operator.

但是<>在ANSI 99 SQL standard中定义,而= =不是。因此,并非所有数据库引擎都支持它,如果您想生成可移植代码,我建议使用<&gt ;.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读