After testing found in MySQL with <> and!= is OK, but SQL Server does not recognize!=, so it is recommended to use <>
Selece * from jb51 where id<>45
the difference between the symbol <> the!= in SQL
<> and!= are not equal, but generally <> code is not equal to because <> works in any SQL but!= is used in sql2000, it is a syntax error, incompatible
MySQL simple query is not equal to NULL
The data in the query table that AA is null:
SELECT * FROM table where AA is null;
Data in a query table that is not equal to 1:
SELECT * FROM table where AA <> 1;
Null value operation:
A null value can be surprising until you get used to it. Conceptually, null means "no value" or "Unknown value", and it is considered a distinct value. In order to test NULL, you cannot use arithmetic comparison operators such as =, < or!=. To illustrate this, try the following query:
mysql> SELECT 1 = null, 1 <> NULL, 1 < NULL, 1 > NULL;
+----------+-----------+----------+----------+
| 1 = NULL | 1 <> NULL | 1 < NULL | 1 > NULL |
+----------+-----------+----------+----------+
| NULL | NULL | NULL | NULL |
+----------+-----------+----------+----------+
Obviously you can't get meaningful results from these comparisons. Instead, use is null and are NOT NULL operators:
mysql> SELECT 1 is null, 1 are NOT null;
+-----------+---------------+
| 1 is NULL | 1 is not NULL |
+-----------+---------------+
| 0 | 1 |
+-----------+---------------+
Please note that in MySQL, 0 or null means false and other values mean true. The default truth value of a Boolean operation is 1.
Self-sensing is null or ifnull (SUM (), XXX) is often used in development.
In addition, <> and!= are available in PHP.
$a = = $b equal to TRUE if $a equals $b.
$a = = = $b congruent TRUE if $a equals $b, and they are of the same type. (PHP 4 Introduction)
$a!= $b Unequal TRUE If $a is not equal to $b.
$a <> $b is not equal to TRUE if $a is not equivalent to $b.
$a!== $b are not congruent TRUE if $a is not equal to $b, or they are of different types. (PHP 4 Introduction)
$a < $b small and TRUE if $a are strictly smaller than $b.
$a > $b is greater than TRUE if $a strictly $b.
$a <= $b is less than or equal to TRUE if $a is less than or equal to $b.
$a >= $b greater than or equal to TRUE if $a is greater than or equal to $b.