17.10 - Example: Using the System Virtual Columns in a Query - 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)
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