Reputation: 63
Need some help with SQL in DB2.
The schema SRC_TEST_PRD has hundreds of tables. I want the SQL to return :
the tablename
and the column name for all of those where the column name is LIKE 'DESC'.
Upvotes: 2
Views: 851
Reputation: 222432
In DB2, you can query catalog view syscat.columns
:
select tabname, colname
from syscat.columns
where tabschema = 'SRC_TEST_PRD' and colname like '%DESC%'
Upvotes: 1