There are two types of inequality symbols in mysql: "!=" and "<>"; they can both be used to determine whether numbers, strings, and expressions are not equal. For "!=" and "<>", if the operands on both sides are not equal, the return value is 1, otherwise the return value is 0; if one of the operands on both sides is NULL, the return value is also NULL.
The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.
In mysql, there are two types of inequality symbols:
##<>
!=
<> or
!=) can be used for judgment Whether numbers, strings, and expressions are not equal. If the operands on both sides are not equal, the return value is 1, otherwise the return value is 0; if one of the operands on both sides is NULL, the return value is also NULL.
Example:Use <> and != to judge inequality
mysql> SELECT 'good'<>'god',1<>2,4!=4,5.5!=5,(1+3)!=(2+1),NULL<>NULL; +---------------+------+------+--------+--------------+------------+ | 'good'<>'god' | 1<>2 | 4!=4 | 5.5!=5 | (1+3)!=(2+1) | NULL<>NULL | +---------------+------+------+--------+--------------+------------+ | 1 | 1 | 0 | 1 | 1 | NULL | +---------------+------+------+--------+--------------+------------+ 1 row in set (0.00 sec)
mysql video tutorial]
The above is the detailed content of What is the not equal symbol in mysql. For more information, please follow other related articles on the PHP Chinese website!