Joe Celko's SQL for Smarties: Advanced SQL Programming, Third Edition

Chapter 9: Comparison or Theta Operators

Overview

Dr. codd introduced the term "theta operators" in his early papers to refer to what a programmer would have called comparison predicate operators. The large number of data types in SQL makes doing comparisons a little harder than in other programming languages. Values of one data type have to be promoted to values of the other data type before the comparison can be done. The available data types are implementation-and hardware-dependent, so read the manuals for your product.

The comparison operators are overloaded and will work for , , and data types. The symbols and meanings for comparison operators are shown in table 9.1.

Table 9.1: Symbols and Meanings for Comparison Operators
operator     numeric      character                   datetime========================================================================== < :         less than    (collates before)           (earlier than) = :         equal        (collates equal to)         (same time as) > :         greater than (collates after)            (later than)<= :       ...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Data Collection Terminals
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.