USING TIMECODE Usage Notes | Teradata Vantage - Usage Notes - Advanced SQL Engine - Teradata Database

Time Series Tables and Operations

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
cxa1555383531762.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1208
lifecycle
previous
Product Category
Teradata Vantageā„¢
  • The USING TIMECODE clause must be specified after the GROUP BY TIME clause.
  • The database may infer TD_TIMECODE as the timecode column when there is a single source present anywhere in the scope of the GROUP BY TIME clause that is a PTI table, if the desired columns are not explicitly stated in the USING TIMECODE clause.
  • The database may infer TD_SEQNO as the sequence number column when there is a single source present anywhere in the scope of the GROUP BY TIME clause that is a sequenced PTI table, if the desired columns are not explicitly stated in the USING TIMECODE clause. Note, to infer the sequence number, the source must be a sequenced PTI table.
  • Column expressions are not allowed in the USING TIMECODE clause; only column names or column aliases are allowed.
  • When the USING TIMECODE clause is not specified:
    • If there is a PTI table in the GROUP BY TIME query, the database will infer TD_TIMECODE as the timecode column if there is only one PTI table.
    • If there is no PTI table in the GROUP BY TIME query an error is reported.
    • If there are Multiple PTI tables in the GROUP BY TIME query an error is reported.
    • Note that these restrictions apply per query block and all Vantage rules apply when specifying columns and their sources implicitly. In particular, the USING TIMECODE clause is explicitly needed when a GROUP BY TIME clause is used in a subquery with no FROM clause.