Using help and show to resolve query issues

To observe statistics on a table, we use the help stats command. This gives an overview of stats collected on the table level:

/*Help statistics*/HELP STATISTICS ON web_clicks;Date Time            Unique Values   Column Names‐‐‐‐‐‐‐‐             ‐‐‐‐‐‐‐‐         ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐   17/07/07 10:49:55       100              * (represent number of rows in table)17/07/07 10:49:55       100               date
  • Date Time: Represents the date and time of stats collected. Helps to identify how old stats are.
  • Unique Values: Number of unique values for a column, or combination of columns, in case of multi-column stats.
  • Column Name: Name of the column on which stats are collected. The HELP STATISTICS command is enhanced to show the expression statistics. It shows the name given ...

Get Teradata Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.