16.20 - Example: Using the System Virtual Columns in a Query - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ Time Series Tables and Operations

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Content Type
Programming Reference
Publication ID
B035-1208-162K
Language
English (United States)
Last Update
2019-05-02
SELECT $TD_TIMECODE_RANGE, $TD_GROUP_BY_TIME, BUOYID, AVG(TEMPERATURE)
FROM OCEAN_BUOYS
WHERE TD_TIMECODE BETWEEN TIMESTAMP '2014-01-06 08:00:00' AND TIMESTAMP '2014-01-06 10:00:00'
GROUP BY TIME(MINUTES(30) AND BUOYID);

Result:

TIMECODE_RANGE GROUP BY TIME (MINUTES(30)) BUOYID AVG (TEMPERATURE)
('2014-01-06 09:00:00.000000+00:00', '2014-01-06 09:30:00.000000+00:00') 3 1 74
('2014-01-06 08:00:00.000000+00:00', '2014-01-06 08:30:00.000000+00:00') 1 0 55