1 – first-clause
FIRST value-expr
Specifies how many records are in the record stream formed by
the record selection expression (RSE). The value expression,
value-expr, is a symbol or string of symbols used to calculate
a value. The value expression in a FIRST clause must either
be a positive number or a value expression that evaluates to a
positive integer. The record stream cannot contain more records
than the number specified by the value expression.
2 – relation-clause
context-var IN relation-name
Declares context variables for a record stream or a loop. The
context variable specifies a temporary name that identifies the
record stream to the product evaluating the clause. You then use
the context variable to refer to fields from that relation. The
relation name specifies the relation from which CDO will take the
records in the record stream.
3 – cross-clause
{ CROSS relation-clause } ...
Allows you to combine records from two or more record streams.
You join these records in combinations based on the relationship
between the values of fields in each record stream. This
combination is called a relational join.
The relation clause declares context variables for a record
stream or loop.
4 – with-clause
WITH cond-expr
Allows you to specify conditions that must be true for CDO to
include a record in a record stream. You specify any conditional
expression in this clause.
The record becomes part of a record stream only when its
values satisfy the conditions you specified in the conditional
expression (that is, only when the conditional expression is
true). If the conditional expression evaluates to false or
missing for a record, that record is not included in the record
stream.
5 – reduced-clause
REDUCED TO value-expr ,...
Allows you to eliminate duplicate values for fields in a record
stream and to group the records in a relation according to
unique field values. However, only using the REDUCED clause
does not guarantee the sort order within groups and the results
are unpredictable. To ensure specific order, use the SORTED BY
clause.
The value expression, value-expr, specifies a symbol or string of
symbols used to calculate a value.
6 – sort-clause
{ }
SORTED BY { [ ASCENDING ] value-expr } ,...
{ [ DESCENDING ] }
{ }
Allows you to sort the records in the record stream by the values
of specific fields. The value expression, or sort key, determines
the order in which CDO returns records. The default for an
initial sort key is ASCENDING. The default for subsequent keys
is the specification for the initial key.
The value expression, value-expr, specifies the value to sort by;
this value is called the sort key.