🎁 Exclusive offer: Get EXTRA Bits and Celebrate Bybit's 6th Birthday With $2.2M Prize Pool. Act Now!

Code has been added to clipboard!

How to Use SQL Not Equal Operator

Reading time 1 min
Published Sep 17, 2019
Updated Oct 3, 2019

What Is Not Equal in SQL

The SQL Not Equal operator belongs to the group of comparison operators which means it can be used to compare expressions. In this case, an expression is a combination of symbols that has a single data value. It can be variables, constants, columns or scalar functions.

As SQL Not Equal is a binary operator, it cannot be used to compare more than two expressions at once.

DataCamp
Pros
  • Easy to use with a learn-by-doing approach
  • Offers quality content
  • Gamified in-browser coding experience
  • The price matches the quality
  • Suitable for learners ranging from beginner to advanced
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable
Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid Certificates of completion
edX
Pros
  • A wide range of learning programs
  • University-level courses
  • Easy to navigate
  • Verified certificates
  • Free learning track available
Main Features
  • University-level courses
  • Suitable for enterprises
  • Verified certificates of completion

Return Values of SQL Not Equal

SQL Not Equal is a boolean operator. That means its return value can be either True (if one expression in SQL does not equal the other) or False (if the expressions are equal).

If either of the expressions has a NULL value, the SQL Not Equal will also return Null:

Sql Not Equal

Two Types of Syntax for Not Equal

There are two ways to write the SQL Not Equal operator:

Example
exp <> exp
exp != exp

Both of them achieve the same result. However, we recommend you to use the first type of syntax, as it complies with the ISO standard, while the second one does not.