USING TIMECODE Usage Notes | Teradata Vantage - 17.00 - Usage Notes - Teradata Database

Teradata Vantageā„¢ - Time Series Tables and Operations

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
created_date
June 2020
category
Programming Reference
featnum
B035-1208-170K
  • 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.