Skip to content

Instantly share code, notes, and snippets.

@MattSandy
Created October 27, 2015 17:16
Show Gist options
  • Save MattSandy/ff707838b6ce83b6549d to your computer and use it in GitHub Desktop.
Save MattSandy/ff707838b6ce83b6549d to your computer and use it in GitHub Desktop.
Grab all columns from rows matching prefix.
SELECT `TABLE_NAME`,`COLUMN_NAME`
FROM `INFORMATION_SCHEMA`.`COLUMNS`
WHERE `TABLE_SCHEMA`='wordpress'
AND `TABLE_NAME` LIKE 'wp_%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment