Previous Topic: Use the ORDER BY Clause to Arrange ValuesNext Topic: Use Comparison Predicates in WHERE Clauses


Use the WHERE Clause to Select Values

There are various tools that you can use to perform searches using the WHERE clause. Following is a list of each of these tools:

To select values in a WHERE clause

Use the following syntax:

WHERE
   [NOT]{predicate}
   [AND|OR [NOT] predicate]

Example: WHERE Clause

Suppose you want all rows from the APPLICATIONS table where the last updated date is equal to 2009-02-13 and the status is equal to UP. To select these rows, use this WHERE clause:

WHERE UPDATE = DATE '2009-02-13' AND STATUS = 'UP'

By including the NOT operator, you can use a WHERE clause to find all rows except those that were last updated on February 13, 2009:

WHERE NOT UPDATE = DATE '2009-02-13'