20 Jan 2009

List all tables with a specific column name in MySQL

This is just a simple query which I found useful a few times to find all the tables on a database that have a specific column name.


SELECT table_name
FROM information_schema.columns
WHERE table_schema = "MY_DB_SCHEMA"
AND column_name = "THE_COLUMN_NAME";

No comments: