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

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Release Date
September 2020
Content Type
Programming Reference
Publication ID
B035-1144-170K
Language
English (United States)

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