What would you like to know more about?

SQL Comparisons

SQL supports many types of comparisons. Comparisons start with the basic pattern:

<field> <operator> <value>

Different Operators For Different Types of Values

Valid operators change depending on the value you are comparing:

  • The operator for NULL is different than the operators for numbers or text.
  • The operators for a list or range is different than the operator for a single value.
  • The operator for exact text is different than text with a wildcard.

Some comparisons require an extended syntax, with examples below. These include IN, BETWEEN, and NULL.