|
SQL supports different comparison operators. They can be used to compare attributes with constants or with other attributes.
DIf an operator is used to compare an attribute with a constant, we talk about restriction. If the
operator is used to compare two attributes, then we talk about a join. With
joins, data from different relations can be compared and combined. Of course
only attributes with the same domain (value range) can be compared.
The following comparison operators for numerical attributes are supported:
=
equal
>
greater
<
less
>=
greater than or equal
<=
less than or equal
<>
not equal
BETWEEN
between
Conditions usually have the syntax <atribute> <operator> <value>
.
The operator BETWEEN
has a somehow different syntax (see the example).
Other comparison operators are discussed in the next paragraphs.