NOT EQUAL Operator in SQL

NOT EQUAL Operator in SQL is used to compare two values and return if they are not equal.

This operator returns boolean values. If given expressions are equal, the operator returns false otherwise true. If any one expression is NULL, it will return NULL.

It performs type conversion when expressions are of different data types, for example, 5!= “Five”.

We use the NOT EQUAL operator to display our table without some exceptional values. For example, Let’s, consider a table ‘Students’. For this table, we have, “id”, “name”, and “marks” as its columns. Now we want to display all those rows that have marks not equal to “100”. In this kind of situation, the NOT EQUAL operator can be used.

Note: <> and != perform the same operation i.e. check inequality. The only difference between <> and != is that <> follows 
the ISO standard but != does not. So it is recommended to use <> for NOT EQUAL Operator.

SQL NOT EQUAL Operator

SQL NOT EQUAL Operator is a comparison operator used to check whether two expressions are equal. This operator is represented by ” != ” or “<>“.

Similar Reads

NOT EQUAL Operator in SQL

NOT EQUAL Operator in SQL is used to compare two values and return if they are not equal....

Syntax

The SQL NOT EQUAL Operator syntax is:...

NOT EQUAL Operator Examples

Let’s look at some examples of the NOT EQUAL Operator in SQL, and understand its working....

Important Points About SQL NOT EQUAL Operator

SQL NOT EQUAL Operator is a comparison operator denoted as != or <>. It returns boolean values i.e. True or False.It returns False when the compared expressions are equal otherwise it returns True.We use this operator with the WHERE clause.We can use this operator for integers and strings-based logical reasoning. It is case-sensitive for string comparisons.We can put multiple conditions using the AND or OR operator....

Contact Us