title: How to run SQL query inside docker container and export results outside the container (.CSV)
body: <p>In SQL server I tried to export a CSV file using below command</p>
  <pre><code>mysql&gt; mysql -u username -p --host=rdshostname --port=rdsport --batch -e &quot;select * from yourtable&quot; | sed 's/\t/&quot;,&quot;/g;s/^/&quot;/;s/$/&quot;/;s/\n//' &gt; export.csv
  </code></pre>
  <p>But no luck, So How I can export the above query result to CSV file?</p>