MySQL Forums
Forum List  »  Newbie

Re: Exporting to CSV with Headers
Posted by: Peter Brawley
Date: May 24, 2018 07:14AM

> There doesn't seem to be one that does not manually enumerate all the columns.

To avoid having to do it manually, you could generate it from information_schema ...

select group_concat( column_name order by ordinal_position separator ' ')
from information_schema.columns
where table_schema='db' and table_name='tbl'
union
...



Edited 1 time(s). Last edit at 05/24/2018 07:21AM by Peter Brawley.

Options: ReplyQuote


Subject
Written By
Posted
Re: Exporting to CSV with Headers
May 24, 2018 07:14AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.