Example: Creating a Join Index with a Character Partitioning Expression - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

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