Example

Teradata Vantageā„¢ SQL Functions, Expressions, and Predicates

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

The following example returns the average number of rows per row hash, where columns date_field and time_field constitute the primary index of the table eventlog.

   SELECT COUNT(*) / COUNT(DISTINCT HASHROW (date_field,time_field)) 
   FROM eventlog;

If columns date_field and time_field qualify for a unique index, this example returns the average number of rows with the same hash synonym.