Om alle tabellen met kolommen columnA
. te krijgen of ColumnB
in de database YourDatabase
:
SELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME IN ('columnA','ColumnB')
AND TABLE_SCHEMA='YourDatabase';
Om alle tabellen met kolommen columnA
. te krijgen of ColumnB
in de database YourDatabase
:
SELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME IN ('columnA','ColumnB')
AND TABLE_SCHEMA='YourDatabase';