Reputation: 50
I'm trying to fetch all the table name with certain column value inside it. For example, table A has 3 columns, one of these columns has the value 'testvalue'
table b has 6 columns, one of these columns has the value 'testvalue'
I want to get table a and b names, is there any query to do this?
Upvotes: 0
Views: 40
Reputation: 71
To get all tables with a specific column name.
SELECT table_name, column_name
FROM information_schema.columns
WHERE column_name = 'testvalue'
Upvotes: 1