In this article we will see "How to SELECT data FROM a Table based on NOT EQUALS condition in MySql" and "MySql SELECT NOT EQUALS query syntax with example".

"NOT EQUALS" query syntax

"NOT EQUALS" is used to SELECT conditional data FROM a Table in MySql, the syntax is as follow.


SELECT column1, column2, ...
FROM tableName
<> condition;

"NOT EQUALS" query example

"<>" can be used to SELECT conditional data FROM a Table in MySql, as shown in the example below.


/* NOT EQUALS data */
SELECT * from testTable WHERE id <> 1;

Output: Output will be something like this:


+------+----------------------+-----------+
| id   | email                | name      |
+------+----------------------+-----------+
|    2 | NULL                 | techburps |
|    3 | career@techburps.com | career    |
|    4 | sales@techburps.com  | sales     |
+------+----------------------+-----------+
3 rows in set (0.00 sec)



In this article we have seen "How to SELECT data FROM a Table based on NOT EQUALS condition in MySql", in upcoming articles we will see more about Mysql syntax and queries with example.
  • By Techburps.com
  • Oct 17, 2017
  • MySql