List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:January 10 2011 3:22pm
Subject:RE: export result from select statement
View as plain text  
>-----Original Message-----
>From: Michael Dykman [mailto:mdykman@stripped]
>Sent: Sunday, January 09, 2011 3:02 PM
>To: LAMP; mysql@stripped
>Subject: Re: export result from select statement
>
>I  second Jerry's recommendation.  It always works like a charm for me.
>
[JS] Thanks.

By the way, if your SELECT is easy to type you can use the -e parameter on the 
MySQL command line.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@stripped
Web site: www.the-infoshop.com



> - michael dykman
>
>On Sun, Jan 9, 2011 at 2:44 PM, Jerry Schwartz <jerry@stripped> wrote:
>> The technique I've settled on is this:
>>
>> mysql blah blah blah < the_select_query.sql > the_output_i_want.txt
>>
>> That gives you a tab-delimited text file with column headings.
>>
>> Regards,
>>
>> Jerry Schwartz
>> Global Information Incorporated
>> 195 Farmington Ave.
>> Farmington, CT 06032
>>
>> 860.674.8796 / FAX: 860.674.8341
>> E-mail: jerry@stripped
>> Web site: www.the-infoshop.com
>>
>>>-----Original Message-----
>>>From: LAMP [mailto:lamp@stripped]
>>>Sent: Saturday, January 08, 2011 6:05 PM
>>>To: mysql@stripped
>>>Subject: export result from select statement
>>>
>>>Hi guys,
>>>I wonder how to store to csv or txt file result from SELECT query?
>>>not a whole table nor database. Just results from SELECT query.
>>>Usually I use MySQL Query Browser and Export feature, but in this
>>>case I don't have access with MySQL Query Browser. Though, I have a
>>>command line access.
>>>I found on one place something like
>>>#SELECT 2+2 into outfile '/path/to/specific/directory/test.csv';
>>>Though, it doesn't work?!?
>>>
>>>Thanks.
>>>
>>>--
>>>MySQL General Mailing List
>>>For list archives: http://lists.mysql.com/mysql
>>>To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>>
>>
>>
>>
>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>>
>>
>
>
>
>--
> - michael dykman
> - mdykman@stripped
>
> May the Source be with you.
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe:    http://lists.mysql.com/mysql?unsub=1




Thread
export result from select statementLAMP9 Jan
  • Re: export result from select statementEric Bergen9 Jan
    • Re: export result from select statementLAMP10 Jan
  • RE: export result from select statementJerry Schwartz9 Jan
    • Re: export result from select statementMichael Dykman9 Jan
      • RE: export result from select statementJerry Schwartz10 Jan
    • Re: export result from select statementLAMP10 Jan
      • Re: export result from select statementYogesh Kore10 Jan
      • RE: export result from select statementJerry Schwartz10 Jan