16.20 - 例: 時系列でSTDDEV_POPの使用 - Teradata Vantage NewSQL Engine

Teradata Vantage™ 時系列テーブルおよび操作

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
プログラミング リファレンス
featnum
B035-1208-162K-JPN

PTIテーブルの場合:

SELECT $TD_TIMECODE_RANGE, $TD_GROUP_BY_TIME, BUOYID, STDDEV_POP(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;

非PTIテーブルの場合:

SELECT $TD_TIMECODE_RANGE, $TD_GROUP_BY_TIME, BUOYID, STDDEV_POP(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 STDDEV_POP (TEMPERATURE)
('2014-01-06 08:00:00.000000+00:00', '2014-01-06 08:10:00.000000+00:00') 1 0 4.45000000000000E 001
('2014-01-06 08:10:00.000000+00:00', '2014-01-06 08:20:00.000000+00:00') 2 0 4.50000000000000E 001
('2014-01-06 09:00:00.000000+00:00', '2014-01-06 09:10:00.000000+00:00') 7 1 3.59397644214130E 000
('2014-01-06 10:00:00.000000+00:00', '2014-01-06 10:10:00.000000+00:00') 13 44 5.46260011349907E 000
('2014-01-06 10:10:00.000000+00:00', '2014-01-06 10:20:00.000000+00:00') 14 44 0.00000000000000E 000