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

参见英文答案 > 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 ;.

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 &#39;EastRiver&#39; 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...