例: 時系列でVAR_SAMPの使用 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - 時系列テーブルと操作の概要

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
2021年7月
Language
日本語
Last Update
2021-09-23
dita:mapPath
ja-JP/zzg1600277315070.ditamap
dita:ditavalPath
ja-JP/wrg1590696035526.ditaval
dita:id
B035-1208
Product Category
Software
Teradata Vantage
/*PTI Table*/
SELECT $TD_TIMECODE_RANGE, $TD_GROUP_BY_TIME, BUOYID, VAR_SAMP(CAST(TEMPERATURE AS REAL))
FROM OCEAN_BUOYS
WHERE TD_TIMECODE BETWEEN TIMESTAMP '2014-01-06 08:00:00' AND TIMESTAMP '2014-01-06 10:30:00'
GROUP BY TIME (MINUTES(10) AND BUOYID)
ORDER BY 3,2,1;

/*Non-PTI Table*/
SELECT $TD_TIMECODE_RANGE, $TD_GROUP_BY_TIME, BUOYID, VAR_SAMP(CAST(TEMPERATURE AS REAL))
FROM OCEAN_BUOYS_NONPTI
WHERE TIMECODE BETWEEN TIMESTAMP '2014-01-06 08:00:00' AND TIMESTAMP '2014-01-06 10:30:00'
GROUP BY TIME (MINUTES(10) AND BUOYID)
USING TIMECODE(TIMECODE)
ORDER BY 3,2,1;

結果:

両方のクエリーの結果は同じであるため、1つの結果セットだけが表示されます。
TIMECODE_RANGE GROUP BY TIME (MINUTES(10)) BUOYID Var_Pop (TEMPERATURE)
('2014-01-06 08:00:00.000000+00:00', '2014-01-06 08:10:00.000000+00:00') 1 0 3.96050000000000E 003
('2014-01-06 08:10:00.000000+00:00', '2014-01-06 08:20:00.000000+00:00') 2 0 4.05000000000000E 003
('2014-01-06 09:00:00.000000+00:00', '2014-01-06 09:10:00.000000+00:00') 7 1 1.55000000000000E 001
('2014-01-06 10:00:00.000000+00:00', '2014-01-06 10:10:00.000000+00:00') 13 44 3.31555555555556E 001
('2014-01-06 10:10:00.000000+00:00', '2014-01-06 10:20:00.000000+00:00') 14 44 ?