Home >Database >Mysql Tutorial >'Not equal to' in oracle/mysql <> != ^= is not the same?
!= in oracle <> and ^= are not equal, and there is no logical difference. Officially recommended <> because it is cross-platform, portable and has strong compatibility.
is not equal, which implies that it is not empty, that is, is not null.
name <> 'Mike' will find the data whose name is not Mike and is not empty.
In mysql, <> and != are the same.
is not is used to judge null, that is, is not null, not empty. select * from t where id is not null; Translated into Chinese, it is to find the data whose id is not empty from the t table. This is why the expression is not was invented specifically for null. Because the statement "equal to nothing" is indeed not rigorous. A certain value can be equal to 1 or 2, but it should not be said to be equal to empty, because it is empty.
!=, <>, and ^= in oracle all mean "not equal to" and have no logical essence. The difference
But the important thing is that while expressing the meaning of "not equal to", the three symbols also imply the premise of "is not null", so null will be filtered out when used.
For example, three pieces of data in the database
Gender | |
---|---|
男 | |
女 |
The above is the detailed content of 'Not equal to' in oracle/mysql <> != ^= is not the same?. For more information, please follow other related articles on the PHP Chinese website!