Example: Using TD_NORMALIZE_OVERLAP - 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, duration) AS
   (SELECT flight_id, duration FROM FlightExp)
SELECT * 
FROM TABLE (TD_SYSFNLIB.TD_NORMALIZE_OVERLAP(NEW VARIANT_TYPE(subtbl.flight_id),
                                             subtbl.duration)
RETURNS (flight_id INT, duration PERIOD(TIMESTAMP(6) WITH TIME ZONE), NrmCount INT)
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, duration, NrmCount) ORDER BY 1,2;