MySQL column names as csv header

select GROUP_CONCAT(CONCAT("'",COLUMN_NAME,"'")) from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'table' AND TABLE_SCHEMA = 'schema' order BY ORDINAL_POSITION
create csv header from table column names

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.