looking for a simple query to find all tables within a database that have a certain "id" column, confusing myself as not all the tables contain this "id"
CodePudding user response:
Using INFORMATION_SCHEMA.COLUMNS:
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME = 'id'