!= 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.
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 “!=” 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.
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.
<> 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.
No way, TIL
=D
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.
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.
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.