Click on this push button to display a list of sample predicates.
Sample WHERE clauses:
The following examples show WHERE clauses (row predicates) that you can use to filter rows of the target table. Most are very general and designed for you to use as a model. Some examples may not conform to your database manager's SQL syntax. See your database's SQL reference for more information about WHERE clauses.
To copy only the rows that contain a specific value, such as MGR for employees that are managers, use a WHERE clause like:
EMPLOYEE = 'MGR'
To copy only the rows within a range, such as employee numbers between 5000 and 7000, use a WHERE clause like:
EMPID BETWEEN 5000 AND 7000
To specify that a table be copied between a designated time period, such as 5:00 PM and 8:00 PM, use a WHERE clause like:
HOUR(CURRENT TIMESTAMP) > 17 AND HOUR(CURRENT TIMESTAMP) < 20
In a change aggregate table created by an SQL expression, such as SUM(CUSTBALANCE), you can use a WHERE clause to specify which rows are used in the calculation to create the table.
For example, if you want to include only recent inserts and updates, and filter out deleted rows, use a WHERE clause like:
IBMSNAP_OPERATION IN('I','U')
Notes for this example:
You can use the following operators in an SQL expression for a WHERE clause or a computed column. All normal restrictions apply to the operators. See your database's SQL reference guide for information about additional operators and restrictions for your database.
Operators:
Column functions:
Scalar functions:
Predicate comparison operators: