Input and Output - Advanced SQL Engine - Teradata Database

SQL Date and Time Functions and Expressions

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
dzx1591742169550.ditamap
dita:ditavalPath
dzx1591742169550.ditaval
dita:id
B035-1211
lifecycle
previous
Product Category
Teradata Vantageā„¢
TD_NORMALIZE_OVERLAP_MEET is a table function that takes two arguments. The arguments passed to the function are the specified columns in a subtable derived from using the WITH Request Modifier as follows:
  • The first argument is one or more grouping columns, not including the Period column. You must specify this argument as a dynamic UDT, where each column is an attribute of the UDT. For details, see the information about NEW VARIANT_TYPE in Teradata Vantageā„¢ - Data Types and Literals, B035-1143.
  • The second argument is the Period column where you want to find the Period values that overlap or meet.
Input to the table function must be columns that are hash-redistributed on the grouping columns and sorted by the grouping columns and the Period values as follows:
  • You must specify a LOCAL ORDER BY clause that includes all of the grouping columns and the Period column in the same order that was specified in the input arguments. The sort order must be ascending.
  • You must include a HASH BY clause with at least one of the grouping columns. The HASH BY clause cannot include the Period column or any columns that are not part of the grouping columns.
You must invoke the function with a RETURNS clause that specifies the output columns as follows:
  • You must specify the output columns to be the same as the columns specified in the input arguments, including the Period column.
  • You must specify the output columns with the same data types and in the same order as the corresponding input columns.
  • You can specify an optional INTEGER output column at the end of the RETURNS clause to contain a count of the rows that were normalized.