17.10 - Example Query - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
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;