Home >Database >Mysql Tutorial >'Not equal to' in oracle/mysql <> != ^= is not the same?

'Not equal to' in oracle/mysql <> != ^= is not the same?

WBOY
WBOYforward
2023-06-02 21:03:33963browse

    oracle "Not equal to" in mysql <> != ^= is not

    oracle

    != 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.

    mysql

    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.

    The three symbols of !=, <> and ^=

    !=, <>, 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

    ##NameGender张三男李四#王五But the official recommendation is to write "<>" because it is more portable across platforms.

    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!

    Statement:
    This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete