Example - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
zsn1556242031050.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantageā„¢

Assume pt is a PERIOD(TIME(2)) column in table t with a value of PERIOD '(12:12:12.34, 12:12:12.35)'.

In the following example, a PERIOD(TIME(2)) column is cast as TIME(6). The TIME(6) result is obtained from the source beginning element with trailing zeros added to the fractional seconds to make the precision 6.

SELECT CAST(pt AS TIME(6)) FROM t;

The following is returned:

12:12:12.340000