Example: Creating a Join Index With a Character Partitioning Expression - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

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));