title: SELECT INTO OUTFILE WITH "WHERE" statement
body: <p>I'm trying to export the DB records from the table via "SELECT INTO OUTFILE".
  Everything works. But I need to filter the records and this is the problem.
  Here's the code:</p>
  
  <pre><code>SELECT * INTO OUTFILE 'file.txt' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'
  FROM table_name WHERE name LIKE '%John%' AND LENGTH(name) &lt;= 10 ORDER BY name
  </code></pre>
  
  <p>This statement doesn't work, but if I remove the "name LIKE '%John%'" condition, it works.
  But I need to specify this LIKE condition, how can I accomplish it?</p>
  
  <p>Thanks.</p>