Skip to content

Instantly share code, notes, and snippets.

@ncremins
Created October 1, 2012 16:00
Show Gist options
  • Save ncremins/3812686 to your computer and use it in GitHub Desktop.
Save ncremins/3812686 to your computer and use it in GitHub Desktop.
[MySQL] comma separated column names
SELECT GROUP_CONCAT(column_name ORDER BY ordinal_position)
FROM information_schema.columns
WHERE table_schema = 'DATABASE_HERE' AND table_name = 'TABLE_HERE'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment