What is the meaning of <> in mysql query?
<>
is standard ANSI SQL and stands for not equal or !=
.
<>
means NOT EQUAL TO, !=
also means NOT EQUAL TO. It's just another syntactic sugar. both <>
and !=
are same.
The below two examples are doing the same thing. Query publisher table to bring results which are NOT EQUAL TO <> !=
USA.
SELECT pub_name,country,pub_city,estd FROM publisher WHERE country <> "USA";
SELECT pub_name,country,pub_city,estd FROM publisher WHERE country != "USA";
<>
means not equal to, !=
also means not equal to.
Documentation