17.00 - 17.05 - Example: Using TD_SUM_NORMALIZE_MEET - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
17.05
Release Date
June 2020
Content Type
Programming Reference
Publication ID
B035-1211-170K
Language
English (United States)
WITH subtbl(flight_id, charges, duration) AS
   (SELECT flight_id, charges, duration FROM FlightExp)
SELECT *
FROM TABLE (TD_SYSFNLIB.TD_SUM_NORMALIZE_MEET(NEW VARIANT_TYPE(subtbl.flight_id),
                                              NEW VARIANT_TYPE(subtbl.charges),
                                              subtbl.duration)
RETURNS (flight_id 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;