RE: Column names

"Bonnett, John" <[email protected]> Mon, 13 Nov 2006 09:04:05 +1030
Newsgroups gmane.comp.db.mysql.windows
Message-ID <[email protected]>
You might be able to get what you want like this.

SELECT 'column11', 'column21'
UNION
select table1.colum1,table2.column1 
from table1,table2 
where table1.id=table2.id 
into outfile 'c:/temp/myfiles/test.txt' 
lines terminated by '\r\n'; 

John Bonnett

-----Original Message-----
From: Charles Little [mailto:[email protected]] 
Sent: Sunday, 12 November 2006 5:14 AM
To: [email protected]
Subject: Column names

I am new to mysql. I am using the command below:

select table1.colum1,table2.column1 from table1,table2 where
table1.id=table2.id into outfile 'c:/temp/myfiles/test.txt' lines
terminated by '\r\n';

The data goes to the file ok. I would like to know how to get the names
of column1 & column2 to be placed at the top of the output.

the output file is:                   I would the following:
data data                               column1  column2
data  data                              data  data

Thanks,
Chuck Little

-- 
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:    http://lists.mysql.com/[email protected]