Skip to content

Instantly share code, notes, and snippets.

@stephenhardy
Created May 30, 2016 10:41
Show Gist options
  • Save stephenhardy/a89d672fd9f23b0787d9aebff045940d to your computer and use it in GitHub Desktop.
Save stephenhardy/a89d672fd9f23b0787d9aebff045940d to your computer and use it in GitHub Desktop.

Revisions

  1. stephenhardy created this gist May 30, 2016.
    4 changes: 4 additions & 0 deletions findTablesWithColumnsMySQL.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    SELECT DISTINCT TABLE_NAME
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE COLUMN_NAME IN ('columnA','ColumnB')
    AND TABLE_SCHEMA='YourDatabase';