且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

!=和<>有什么区别?在SQL Server中

更新时间:2022-11-24 21:53:45

没有区别.您可以在MSSQL中同时使用两者.

There is no difference. You can use both in MSSQL.

MSSQL文档说:

!=的功能与<>(不等于)比较运算符相同.

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

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

But <> is defined in the ANSI 99 SQL standard and != is not. So not all DB engines may support it and if you want to generate portable code I recommend using <>.