Find all tables containing a specific column

If you have wondered how can you get all the table names which contains a specific column, here is a simple SQL query which does the same.

select column_name, table_name from information_schema.columns where column_name like "%mycolumname%";
or
select column_name, table_name from information_schema.columns where column_name = "mycolumname";

Leave a Reply