Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 18 Jul 2006 @ 14:24:34 GMT


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


Subj:   Re: How to find the table list for particular value of a column in a Database.
 
From:   Geoffrey Rommel

  I have 600 tables in a Database with column a x1(columname) .Now I want to know how many tables Having x1(columname) = 20 (or any value). Is there any way to find this using Only SQL > (Probably Single Query) and Meta tables?  


I don't think this can be done in a single query, but here's something to get you started:

     sel 'sel '''||trim(tablename)||''', count(*) from '||
      trim(databasename)||'.'||trim(tablename)||
      ' where your_column_name = 20;'
     from dbc.columns
     where columnname = 'your_column_name';


     
  <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