Created
June 18, 2014 16:26
-
-
Save jamespsterling/b3ed21ce4f843422e566 to your computer and use it in GitHub Desktop.
Fast way to get all column headers in a comma-separated list
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 GROUP_CONCAT(CONCAT("'",COLUMN_NAME,"'")) | |
from INFORMATION_SCHEMA.COLUMNS | |
WHERE TABLE_NAME = 'my_table' | |
AND TABLE_SCHEMA = 'my_schema' | |
order BY ORDINAL_POSITION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment