Archives of the TeradataForum
Message Posted: Wed, 28 Feb 2007 @ 20:39:01 GMT
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
|