Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 09 Aug 2002 @ 13:32:01 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

Subj:   Re: Collect statistics
From:   Geoffrey Rommel

  This will show all column statistics.  

   c.databasenamei as DatabaseName,
   b.tvmnamei as TableName,
   a.fieldname as ColumnName,
   cast((case when substr(fieldstatistics,1,1) = 'D2'XB
          > then '2002-'
          > when substr(fieldstatistics,1,1) = 'D1'XB
          > then '2001-'
          > ...... etc. .............

You could also enter these values in a separate table and join to it -- like so:

create table stats_dates ...
 stats_date_byte   byte(4),
 stats_date  date ) ...;

insert into stats_dates values ('D2000101'xb, date '2002-01-01');  /* and many more */
select ...
 from dbc.tvfields a,
  stats_dates b
 where substr(a.fieldstatistics, 1,4) = b.stats_date_byte ...;

You get the idea, I'm sure.

  <Prev Next>   <<First <Prev Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023