Column names

------=_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--
Charles Little [ Sa, 11 November 2006 19:44 ] [ ID #1532010 ]

RE: Column names

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=3Dtable2.id
into outfile 'c:/temp/myfiles/test.txt'
lines terminated by '\r\n';

John Bonnett

-----Original Message-----
From: Charles Little [mailto:littles224 [at] mindspring.com]
Sent: Sunday, 12 November 2006 5:14 AM
To: win32 [at] 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 [at] m.gmane.org
John.Bonnett [ So, 12 November 2006 23:34 ] [ ID #1532753 ]
Datenbanken » gmane.comp.db.mysql.windows » Column names

Vorheriges Thema: MySQL 5.0.0-alpha-max-debug upgrade...???
Nächstes Thema: Query Browser Connection Issue