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
Release: 2023-06-02 21:03:33
forward
971 people have browsed it

    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!

    Related labels:
    source:yisu.com
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template