• sp3ctr4l@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    4 days ago

    <> is ‘not equal’ in SQL syntax

    != is another one for ‘not equal’ in SQL, and a good deal of other languages, but I went with <> because of the ls and Is, <> is more visually distinct.

    • FrederikNJS@lemmy.zip
      link
      fedilink
      arrow-up
      1
      ·
      4 days ago

      To some extent the SQL syntax also kind of makes sense… It’s a combination of both “greater than” and “smaller than” operators, which is kind of a different way of saying something is not equal.

      The “!=” comes from most programming languages using the “!” character for negation. Negating something is usually read and pronounced “not”. So it literally reads “not equal” if you are reading the symbols.

      • The_Decryptor@aussie.zone
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 days ago

        The “!=” comes from most programming languages using the “!” character for negation. Negating something is usually read and pronounced “not”. So it literally reads “not equal” if you are reading the symbols.

        And programming languages get it from math, where “inequality” is represented by the symbol “≠”, != is the closest you can get with ASCII.

        Now what’s more interesting is that math uses “¬” to represent “not”, I bet there’s a telegraph keyboard from the 1940s that explains the reasons behind all this.

      • sp3ctr4l@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        4 days ago

        1I don’t really know why <> was chosen as the old school ‘not equal’ for the SQL syntax… I just know it by way of having been working with/in various forms of SQL for… 20+ years?

        If I had to guess, it may have something to do with keeping the character set down to a bare minimum.

        SQL is fucking old, its been improved and modified and evolved over the years, but, it was first invented and formalized back in 1973, when you still had computer (storage) memory as basically giant spools of magnetic tape, personal computers didn’t really exist yet, having 8 KiloBytes of RAM would have been considered astoundingly powerful, years ahead of its time.

        Thats uh, 0.0000076294 GigaBytes of RAM, or I think about 512x less than what a basic Nintendo 64 had.