whats the difference between !=
and <>
in mysql.
which symbol is good to user in sql query for not equal conditio开发者_开发百科n.can someone tell me whats the pros and cons of using the not equal symbol in mysql.
!=
requires 3 keystrokes (Shift, !, =), and <>
requires 3 keystrokes (Shift, <, >). However a touch typist has to switch hands to hit that =
.
You should definitely use <>
over !=
. You'll save at least 10 milliseconds of typing for each use.
There is absolutely no difference in MySQL, but the <>
is the variant present in the SQL ISO standard.
If you're interested in trivia I can tell you that Oracle also has ^=
apart from those two.
There is no difference. According to SQL.org, the != operator is converted to be <> by the compiler/interpreter during execution so in essence it is just an alias.
http://www.sql.org/sql-database/postgresql/manual/functions-comparison.html
精彩评论