Database

MySQL Comparison Operators

MySQL Comparison Operators

In this tutorial, we will learn about MySQL Comparison Operators with examples. Comparison Operators are used to compare the column value expressions.

 

MySQL Comparison Operator Description
= Equal to
< Less than
<= Less than or equal to
<=> Equal to (works even for NULL values)
<>  or != Not equal to
> Greater than
>= Greater than or equal to
BETWEEN..AND.. Indicate a range of values

Operators in WHERE constructs

WHERE constructs that are commonly used in the WHERE clause for comparisons against a column and a subquery are as follows:

  • IN/NOT IN
  • ANY
  • ALL
  • SOME
  • EXISTS/ NOT EXISTS

 

MySQL Tutorials

MySQL Tutorials on this website: