Should I use != or <> for not equal in T-SQL?

前端 未结 14 1851
失恋的感觉
失恋的感觉 2020-11-22 04:23

I have seen SQL that uses both != and <> for not equal. What is the preferred syntax and why?

14条回答
  •  不要未来只要你来
    2020-11-22 05:09

    You can use whichever you like in T-SQL. The documentation says they both function the same way. I prefer !=, because it reads "not equal" to my (C/C++/C# based) mind, but database gurus seem to prefer <>.

提交回复
热议问题