Example: Partitioning Expression That Specifies AT LOCAL Date - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

Assume that column ts has a TIMESTAMP(0) without time zone data type and the current session time zone is INTERVAL '04:00' HOUR TO MINUTE when the table that contains column ts is created with the following PARTITION BY clause. The RANGE_N function has an INTEGER data type.

     PARTITION BY RANGE_N(CAST(ts 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(ts AS DATE AT '04:00') 
                          BETWEEN DATE '2003-01-01' 
                          AND DATE '2009-12-31'
                          EACH INTERVAL '1' MONTH)