Compound search conditions in the WHERE clause

So far, you have seen equal (=) and less than (<) as comparison operators. Sybase IQ also supports other comparison operators, such as greater than (>), greater than or equal (>=), less than or equal (<=), and not equal (<>).

These conditions can be combined using AND and OR to make more complicated search conditions.

Qualifying the list

To list all employees born before March 3, 1964, but exclude the employee named Whitney, type:

SELECT emp_lname, birth_date
FROM employee
WHERE birth_date < '1964-3-3'
AND emp_lname <> 'Whitney'

emp_lname

birth_date

Cobb

1960-12-04 00:00:00.000

Jordan

1951-12-13 00:00:00.000

Breault

1947-05-13 00:00:00.000

Espinoza

1939-12-14 00:00:00.000

Dill

1963-07-19 00:00:00.000

Francis

1954-09-12 00:00:00.000