Skip to content

Instantly share code, notes, and snippets.

@guillaumevoisin
Created October 16, 2014 09:21
Show Gist options
  • Save guillaumevoisin/ad93044a892993ed12b5 to your computer and use it in GitHub Desktop.
Save guillaumevoisin/ad93044a892993ed12b5 to your computer and use it in GitHub Desktop.
To get all tables with columns 'columnA' or 'ColumnB' in the database 'YourDatabase'
SELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME IN ('columnA','ColumnB')
AND TABLE_SCHEMA='YourDatabase';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment