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

前端 未结 14 1980
失恋的感觉
失恋的感觉 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:14

    The ANSI SQL Standard defines <> as the "not equal to" operator,

    http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt (5.2 and )

    There is no != operator according to the ANSI/SQL 92 standard.

提交回复
热议问题