Difference between <> and != in SQL

前端 未结 6 1270
青春惊慌失措
青春惊慌失措 2021-01-01 15:38

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

相关标签:
6条回答
  • 2021-01-01 16:10

    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 16:14

    There is no difference, at least for MySQL.

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

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

    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 16:15

    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 16:15

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

    0 讨论(0)
  • 2021-01-01 16:24

    <> 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)
提交回复
热议问题