例: TD_SUM_NORMALIZE_OVERLAPの使用 - Teradata Database - Teradata Vantage NewSQL Engine - 算術演算子、TD_SUM_NORMALIZE_OVERLAP関数、例。

Teradata Vantage™ SQL日付と時刻の関数および式

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
2019年3月
Language
日本語
Last Update
2019-10-29
dita:mapPath
ja-JP/pxz1544241488545.ditamap
dita:ditavalPath
ja-JP/pxz1544241488545.ditaval
dita:id
B035-1211
Product Category
Software
Teradata Vantage
WITH subtbl(flight_id, charges, duration) AS
     (SELECT flight_id, charges, duration FROM FlightExp)
SELECT * 
     FROM TABLE (TD_SYSFNLIB.TD_SUM_NORMALIZE_OVERLAP(NEW VARIANT_TYPE(subtbl.flight_id),
                 NEW VARIANT_TYPE(subtbl.charges),          
                 subtbl.duration)
RETURNS (flight_id INT, cnt INT, charges FLOAT,
     duration PERIOD(TIMESTAMP(6) WITH TIME ZONE))
HASH BY flight_id /* input data is redistributed on column, flight_id */
LOCAL ORDER BY flight_id, duration) /* input data is sorted on these columns */
AS DT(flight_id, charges, duration) ORDER BY 1,3;