在SQL里面,“<>”是不等于的意思,其实大部分情况下用“!=”也可以,为了不会出错,建议使用<>
,因为这个语法都支持
stackoverflow 上有一个回答
Most databases support !=
(popular programming languages) and <>
(ANSI).
Databases that support both !=
and <>
:
- MySQL 5.1: != and <>
- PostgreSQL 8.3: != and <>
- SQLite: != and <>
- Oracle 10g: != and <>
- Microsoft SQL Server 2000/2005/2008/2012/2016: != and <>
- IBM Informix Dynamic Server 10: != and <>
- InterBase/Firebird: != and <>
- Apache Derby 10.6: != and <>
- Sybase Adaptive Server Enterprise 11.0: != and <>
Databases that support the ANSI standard operator, exclusively: