Example: Summary Multicolumn Statistics - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

Consider the following collect statistics request.

     COLLECT SUMMARY STATISTICS 
       COLUMN CAST(o_orderdatetime AS DATE AT 0) AS OrderDate,
       COLUMN (CAST(o_orderdatetime AS DATE AT 0), o_orderkey) 
               AS OrderDateAndKey
     ON orders;

The following request displays a summary of statistical information for the multicolumn statistics using their names, order_date and order_date_and_key, respectively.

     HELP STATISTICS orders;
*** Help information returned. 3 rows.
*** Total elapsed time was 1 second.
Date     Time     Unique Values        Column Names
-------- -------- -------------------- --------------------------------
10/08/16 18:14:36                  100 *
10/08/16 18:10:48                   15 order_date
10/08/16 18:05:44                  100 order_date_and_key