Example: Partitioning Expression that Specifies an AT LOCAL Date - 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™

Assume that column tsz has a TIMESTAMP(0) WITH TIME ZONE data type and the current session time zone is INTERVAL -'03:00' HOUR TO MINUTE when the join index that contains tsz is created with the following PARTITION BY clause. The data type of the partitioning expression is INTEGER.

     PARTITION BY RANGE_N(CAST(tsz AS DATE AT LOCAL) 
                          BETWEEN DATE '2003-01-01' 
                          AND     DATE '2009-12-31'
                          EACH INTERVAL '1' MONTH)

Vantage implicitly rewrites this partitioning expression, replacing LOCAL with a specific time zone as follows.

     PARTITION BY RANGE_N(CAST(tsz AS DATE AT '-03:00') 
                          BETWEEN DATE '2003-01-01' 
                          AND     DATE '2009-12-31'
                          EACH INTERVAL '1' MONTH)