• Learning MySQL By Example
  • Introduction
  • 1. How to Retrieve Data From a Single Table
  • 2. How to Retrieve Data from Multiple Tables
  • 3. Using Functions
  • 4. How to Insert, Update, Delete Data in Tables
  • 5. Summary Queries and Aggregate Functions
  • 6. Working With Subqueries
  • 7. SQL Views
  • 8. SQL Indexes
  • Glossary
  • Index
  • Download
  • Translations
  • 1.6

    Comparison Operators

    Comparison Operators

    • Comparison operators compare two expressions.
    • The result of a comparison results to true or false.
    • Comparison operators are not case sensitive and are used with text and dates as well as numbers.

    Table 5. Comparison Operators

    Operator

    Description

    =

    Equal

    Less than

    Greater than

    <=

    Less than or equal to

    >=

    Greater than or equal to

    <> 

    Not equal

    !=

    Not equal

    Example:

    USE world;
    SELECT name, population
    FROM country
    WHERE population > 1000000;

    Results:

    comparison_operators.png

    This content is provided to you freely by EdTech Books.

    Access it online or download it at https://edtechbooks.org/learning_mysql/comparison_operators.