16.20 - Example: Creating a Join Index With a Character Partitioning Expression - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-24
dita:mapPath
wkf1512081455740.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval

This example creates join index t_cppi with a character partitioning expression. The data type for column j in this example is CHARACTER and the type of column k is INTEGER.

     CREATE JOIN INDEX t_cppi AS
       SELECT j, k
       FROM t1
     PRIMARY INDEX(j)
     PARTITION BY (CASE_N(j BETWEEN 'aaaa' 
                            AND     'bbbb',
                          j BETWEEN 'cccc' 
                            AND     'dddd'),
                  RANGE_N(k BETWEEN 1 
                            AND 10 
                            EACH    1));