15.10 - Example: Partitioning Expression With TIMESTAMP Data Type - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

Teradata Database
Release Number
December 2015
Content Type
Programming Reference
Publication ID
English (United States)

Assume that column tsz has a TIMESTAMP(0) WITH TIME ZONE data type and the current session time zone is INTERVAL -'07:00' HOUR TO MINUTE when the table that contains column tsz is created with the following PARTITION BY clause. The RANGE_N function has a BIGINT data type.

 PARTITION BY RANGE_N(tsz BETWEEN TIMESTAMP '2003-01-01 00:00:00.000000'
                          AND     TIMESTAMP '2009-12-31 23:59:59.999999' 
                          EACH INTERVAL '1' DAY)

Teradata Database implicitly rewrites this partitioning expression to include the time zone in the timestamp literals as follows.

     RANGE_N(tsz BETWEEN TIMESTAMP '2003-01-01 00:00:00.000000-07:00'
                 AND     TIMESTAMP '2009-12-31 23:59:59.999999-07:00' 
                 EACH INTERVAL '1' DAY)