Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 13 Jan 2012 @ 19:34:25 GMT


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


Subj:   Re: Generate collect statistics statement
 
From:   DAVID WILLIAMS

this is a correction to my last posting:

     SEL TRIM(DATABASENAME) || '.' || TRIM(TABLENAME)  (TITLE'')
     FROM DBC.TABLES A

     WHERE NOT EXISTS

     ( SEL DATABASENAME, TABLENAME
       FROM
          (SEL DATABASENAME,
               TABLENAME
           FROM DBC.COLUMNSTATS
           WHERE FIELDSTATISTICS IS NOT NULL
           GROUP BY 1,2

           UNION

           SEL DATABASENAME,
              TABLENAME
           FROM DBC.MULTICOLUMNSTATS
           WHERE COLUMNSSTATISTICS IS NOT NULL
           GROUP BY 1,2

           UNION

           SEL DATABASENAME,
               TABLENAME
           FROM DBC.INDEXSTATS
           WHERE INDEXSTATISTICS IS NOT NULL
           GROUP BY 1,2) B

     WHERE A.DATABASENAME = B.DATABASENAME
       AND A.TABLENAME    = B.TABLENAME
     )

       AND A.TABLEKIND = 'T'


     
  <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