title: how to save sql query result to csv in pandas
body: <p>I wrote a query in the data frame and want to save it in CSV file
  I tried this code and didn't work</p>
  <pre><code>q1 = &quot;SELECT * FROM  df1 join df2 on df1.Date = df2.Date&quot; 
  df = pd.read_sql(q1,None)
  df.to_csv('data.csv',index=False)
  </code></pre>