Example: Using TD_SUM_NORMALIZE_MEET - Analytics Database - Teradata Vantage

SQL Date and Time Functions and Expressions

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-10-30
dita:mapPath
cpk1628111786971.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
pxz1544241488545
lifecycle
latest
Product Category
Teradata Vantageā„¢
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;