16.20 - Example Query - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)
SELECT *
FROM udaggregation (
   on (select 1 as pa, 2 as pa2, tab1.* from tab1)
   local order by pa ASC NULLS FIRST, pa2 DESC NULLS LAST
   using SUM_AGG('A', 'B')
   AVG_AGG('C')
) AS D;

SELECT *
FROM udaggregation (
on (select 1 as pa, tab1.* from tab1)
partition by pa
using SUM_AGG('A', 'B')
AVG_AGG('C')
) AS D;