Skip to content

Instantly share code, notes, and snippets.

@geoff-maddock
Last active June 15, 2017 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geoff-maddock/a141b62d77c0ef991894fa829570fa78 to your computer and use it in GitHub Desktop.
Save geoff-maddock/a141b62d77c0ef991894fa829570fa78 to your computer and use it in GitHub Desktop.
How to find all columns of a specified data type in MySQL
SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, COLUMN_TYPE, COLUMN_COMMENT, ORDINAL_POSITION FROM information_schema.columns WHERE table_schema = 'dbname' AND DATA_TYPE = 'enum' ORDER BY TABLE_NAME, ORDINAL_POSITION;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment