we do use <> operator for not equal and NOT IN for a list of data item in mysql query
<> operator:
Select those students from table which name does not match with john: compare single name
example: select * from student_table where name <> "john"
NOT IN operator:
Select those students from table which name do not match with "rake", "john", "pwan" : compare multiple name
example: select * from student_table where name NOT IN ("rake", "john", "pwan");
SQL NOT EQUAL
MySQL : query "not equal" doesn't work
MySQL | Comparison Operators in MySQL | Equal Operator | Not Equal Operator | SQL Query|Talat Waheed
24. WHERE Clause and Not equal operator in SQL (Hindi)