Created
May 26, 2017 17:21
-
-
Save hevertonfreitas/077e847d62e60015c4ee1196f5346f5f to your computer and use it in GitHub Desktop.
Rename Columns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CONCAT_WS(' ', 'ALTER TABLE', table_name, 'CHANGE', column_name, 'new_name DATETIME;') | |
FROM information_schema.columns | |
WHERE table_schema = 'database' AND column_name = 'old_name'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment