Jump to content


Photo

Table Export format


  • Please log in to reply
1 reply to this topic

#1 edlentz

edlentz
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 08 April 2006 - 01:43 PM

I need to export a table and I cna't seem to get it right. The format I need is: CSV with all fields enclosed with "" and null or empty fields with a 0 or o in them. Can this be done through a query?

Thanks

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 09 April 2006 - 06:35 PM

You can try the following:

SELECT ... INTO OUTFILE '<yourfile>' FIELDS TERMINATED BY "," LINES TERMINATED BY "\n";'

Any conversion of null/blank to zeros will have to be done as part of the select column expression clause explicity.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users