The syntax for comparison conditions is as follows:
expression compare expression
where compare is a comparison operator. Table 3-4 lists the comparison operators available in 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 |
For example, the following query retrieves the names and birth years of the oldest employees:
SELECT name, year_of_birth FROM employees WHERE year_of_birth <= ALL (SELECT MIN(year_of_birth) FROM employees);
The subqueries that provide comparison values for quantified comparison predicates, as in the preceding example, may retrieve multiple rows but can only have one column.
All string comparisons are:
Case sensitive if the database was created as case respect (the default)
Case insensitive if the database was created as case ignore
Trailing blanks Any trailing blanks in character data are ignored for comparison purposes by Adaptive Server Enterprise. The behavior of Sybase IQ when comparing strings is controlled by an option when creating the database.
Case sensitivity By default, Sybase IQ databases, like Adaptive Server Enterprise databases, are created as case sensitive. Comparisons are carried out with the same attention to case as the database they are operating on. You can control the case sensitivity of Sybase IQ databases when creating the database.