Archives of the TeradataForum
Message Posted: Wed, 28 Feb 2007 @ 20:33:17 GMT
| Subj: || || Re: Is there any way to find all tables which have two particular column in a database |
| From: || || Dieter Noeth |
Murugesan Arumugam wrote:
| ||For example I need to find all tables which are having art_no and client_cd as field using dcb.columns in a single Query using inner
from dbc.columns as 1t1
join dbc.columns as 1t1
on t1.databasename = t2.databasename
and t1.tablename = t2.tablename
t1.columnname = 'art_no'
t2.columnname = 'client_cd'
or without join:
t1.columnname in ('art_no', 'client_cd')
group by 1,2
having count(*) = 2