Posted By

Jamie on 08/16/11


Tagged

mysql


Versions (?)

Save a MySQL Query as a Tab or Comma separated file


 / Published in: MySQL
 

Simple example of how you can output a query as

  1. SELECT
  2. id,
  3. email
  4.  
  5. INTO OUTFILE '/tmp/csv_users.txt'
  6. FIELDS TERMINATED BY '\t'
  7. LINES TERMINATED BY '\n'
  8.  
  9. FROM users
  10.  
  11. ORDER BY created_at
  12. DESC LIMIT 10

Report this snippet  

You need to login to post a comment.