COLLECT DEMOGRAPHICS Examples | SQL Statements | Teradata Vantage - 17.05 - COLLECT DEMOGRAPHICS Examples - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Release Date
January 2021
Content Type
Programming Reference
Publication ID
B035-1146-175K
Language
English (United States)

Example: Collect Demographic Estimates

Collect demographic estimates on table_1 in database db_1 and write the results into the DataDemographics table of user-defined QCD MyQCD.

     COLLECT DEMOGRAPHICS FOR db_1.table_1 INTO MyQCD;

Example: Update Demographic Estimates

An entry already exists in the DataDemographics table for the specified table, then it is updated with the currently collected demographic estimates. The value of TimeStamp is updated to reflect the current time.

     COLLECT DEMOGRAPHICS FOR db_1.table_1 INTO MyQCD; /* Inserts data
     into DataDemographics table of MyQCD */
     COLLECT DEMOGRAPHICS FOR db_1.table_1 INTO MyQCD; /* Updates data
     in DataDemographics table of MyQCD */