Example: Partitioning Expression that Specifies an AT LOCAL Date - Teradata Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Database
Release Number
20.00
Publication Date
June 2025
Content Type
SQL Reference
Publication ID
B035-1144-200K
ft:locale
en-US
ft:lastEdition
2026-09-23
dita:mapPath
mbm1747160743883.ditamap
dita:ditavalPath
jlp1749501702948.ditaval
ft:sourceId
dita
dita:id
mdr1472255012272
lifecycle
latest

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)

Theg system 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)