Bug #34992 Add option to SELECT column names INTO OUTFILE
Submitted: 3 Mar 2008 8:30 Modified: 17 Mar 2008 12:03
Reporter: Hans Ginzel Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:5.0, 5.1, 6.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: SELECT INTO OUTFILE "column names"

[3 Mar 2008 8:30] Hans Ginzel
Description:
Please, add an option to export column headers for SELECT ... INTO OUTFILE command.

It would be much more constructive then fidling with INFORMATION_SCHEMA.

http://lists.mysql.com/mysql/195450

How to repeat:
SELECT *
FROM   some_table
INTO   OUTFILE 'test_outfile.txt'

Suggested fix:
WITH COLUMN_NAMES

OR

WITH HEADER_LINE

There is a need for this.
[17 Mar 2008 12:03] Susanne Ebrecht
Hello Hans,

many thanks for writing a feature request.
The idea of you isn't sql standard conform but I think as an option this could be a possibility.
[26 Jan 2010 8:33] Valeriy Kravchuk
Bug #50612 was marked as a duplicate of this one.