 |
 |
Archives of the TeradataForum
Message Posted: Tue, 18 Jul 2006 @ 14:24:34 GMT
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';
| |