Comparison conditions

The syntax for comparison conditions is as follows:

expression compare expression

where compare is a comparison operator. Table 2-4 lists the comparison operators available in Sybase IQ.

Table 2-4: Comparison operators available in Sybase IQ

Operator

Description

=

Equal to

>

Greater than

<

Less than

>=

Greater than or equal to

<=

Less than or equal to

!=

Not equal to

<>

Not equal to

!>

Not greater than

!<

Not less than

Example

For example, the following query retrieves the names and birth years of the oldest employees:

SELECT Surname, BirthDate 
FROM Employees 
WHERE Surname <= ALL (SELECT MIN(BirthDate) FROM Employees);

The subqueries that provide comparison values for quantified comparison predicates, as in the preceding example, might retrieve multiple rows but can only have one column.

NoteAll string comparisons are:

See the “Usage” section of the CREATE DATABASE statement in Reference: Statements and Options for more details on the results of comparisons in a case-insensitive database.

Compatibility