NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
P-17
Considerations—PARTITION
FIRST KEY { value | ( value [ , value ] ... ) }
specifies the first primary key or clustering key value that can be stored in the
associated partition. FIRST KEY specifies the lowest value for the partition if the
column for the value has an ascending collating sequence; it specifies the highest
value for the partition if the column has a descending collating sequence.
You must specify a FIRST KEY clause for partitions of indexes and partitions of
tables that have user-defined primary keys or clustering keys. (The clause is shown
as optional because it does not apply to relative or entry-sequenced files.)
value is a literal or datetime literal that specifies the first value allowed in the
associated partition for a column of the key. For an index partition (but not for a
table partition), value can also be the keyword NULL, representing a null value.
(A null value is considered greater than all other values and equal to other null
values.)
For a table, the values in the FIRST KEY clause have a one-to-one correspondence
with the columns in the primary key or clustering key of the table. For an index, the
values in the FIRST KEY clause have a one-to-one correspondence with the indexed
columns in the order specified on the CREATE INDEX statement (not including the
keytag column), and the columns of the primary key or clustering key of the
underlying table. Each value must have a data type compatible with the data type of
the column it corresponds to.
If you specify fewer FIRST KEY values than there are columns, SQL uses the
lowest or highest value for the data type of each remaining column. (The lowest
value for an ascending column and the highest value for a descending column.) To
find the highest or lowest value for a specific data type, see one of the following
entries:
Character Data Types
DATETIME Data Type
INTERVAL Data Type
Numeric Data Types
Considerations—PARTITION
Each partition you specify must follow the rules for partitions described in the entry
PARTITIONS.