Column names

Column names

am 11.11.2006 19:44:01 von Charles Little

------=_NextPart_84815C5ABAF209EF376268C8
Content-type: text/plain; charset=US-ASCII

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
------=_NextPart_84815C5ABAF209EF376268C8--

RE: Column names

am 12.11.2006 23:34:05 von John.Bonnett

You might be able to get what you want like this.

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

John Bonnett

-----Original Message-----
From: Charles Little [mailto:littles224@mindspring.com]=20
Sent: Sunday, 12 November 2006 5:14 AM
To: win32@lists.mysql.com
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=3Dtable2.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/win32?unsub=3Dgcdmw-win32@m.gmane.org