USING TIMECODE Usage Notes | Teradata Vantage - 17.10 - Usage Notes - Advanced SQL Engine - Teradata Database
Teradata Vantage⢠- Time Series Tables and Operations
- Product
- Advanced SQL Engine
- Teradata Database
- Release Number
- 17.10
- Release Date
- July 2021
- Content Type
- Programming Reference
- Publication ID
- B035-1208-171K
- Language
- English (United States)
- 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.