Difference between <> and != in SQL

后端 未结 6 829
再見小時候
再見小時候 2021-01-01 14:32

What is the exact Difference between <> and != ?

相关标签:
6条回答
  • 2021-01-01 14:56

    Both are used in SQL Server. Both are used for same purpose. SQL Server 2000 and its previous version don't support != but SQL Server 2005 and SQL Server 2008 supports both <> and !=

    0 讨论(0)
  • 2021-01-01 14:58

    Functionally there's no difference.

    I think this is a matter of programmer preference: '<>' may be preferred by programmers who use various flavors of Pascal or Basic, while '!=' may be preferred by those who use languages which are descendants of C (e.g. C++, Java, C#). Interestingly, though, the C-style equality comparison operator ('==') is not supported in Oracle - how about in other flavors of SQL?

    Share and enjoy.

    0 讨论(0)
  • 2021-01-01 15:01

    In Oracle there is no difference. Can't speak for all other databases.

    0 讨论(0)
  • 2021-01-01 15:06

    None whatsoever, syntactically.

    Both are inequality operators, <> is the SQL-92 standard, however its interchangable on some platforms with != (E.g. SQL Server)

    0 讨论(0)
  • 2021-01-01 15:09

    <> is the only inequality operator in the SQL Standard.

    Lot's of SQL database systems support the use of != including PostgreSQL, SQL Server, MySQL, SQLite, Oracle & Firebird, but some don't, including Apache Derby.

    0 讨论(0)
  • 2021-01-01 15:12

    There is no difference, at least for MySQL.

    See: http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html

    0 讨论(0)
提交回复
热议问题