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

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

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 */