Skip to content

Instantly share code, notes, and snippets.

@markheramis
Created May 21, 2024 19:55
Show Gist options
  • Save markheramis/2046e08dd10bb9c291b8c642ec10c1c7 to your computer and use it in GitHub Desktop.
Save markheramis/2046e08dd10bb9c291b8c642ec10c1c7 to your computer and use it in GitHub Desktop.
Concat Table Columns into one column in the result.
SELECT
GROUP_CONCAT(`COLUMN_NAME` SEPARATOR ',') AS `columns`
FROM `INFORMATION_SCHEMA`.`COLUMNS`
WHERE
`TABLE_SCHEMA` = '<DATABASE>' AND
`TABLE_NAME` = '<TABLE>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment