Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 28 Feb 2007 @ 20:39:01 GMT


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


Subj:   Re: Is there any way to find all tables which have two particular column in a database
 
From:   Michael Larkins

Murugesan:

This would be one way to accomplish your request:

     sel trim(dt1.databasename)||'.'||trim(dt1.tablename)||' has both art_no and client_cd'
     from (sel databasename, tablename from dbc.columns where columnname = 'art_no') dt1
     join  (sel databasename, tablename from dbc.columns where columnname = 'client_cd') dt2
     on dt1.databasename=dt2.databasename and dt1.tablename=dt2.tablename

Regards,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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