OR

You can select rows based on multiple conditions connected by AND or OR. Two conditions connected by OR select every row that satisfies either one of the conditions.

This query:

SELECT ID, NAME, YEARS, SALARY
FROM Q.STAFF
WHERE YEARS = 10 OR SALARY > 20000

Produces this report:

  ID  NAME       YEARS     SALARY
----- ---------  -----  ---------
  50  HANES         10   20659.80
 140  FRAYE          6   21150.00
 160  MOLINARE       7   22959.20
 210  LU            10   20010.00
 260  JONES         12   21234.00
 290  QUILL         10   19818.00
 310  GRAHAM        13   21000.00

Compare the results of OR with AND.

For information on how parentheses clarify the meaning of a query, see Parentheses.

[ Previous Page | Next Page | Contents | Index ]