I have recently started working as an Analyst.Part of my job is to run SQL queries on a daily basis and paste the results in an Excel sheet. This sometime becomes tedious. I would like to automate this process i.e. the SQL query should run automatically and the result set(s) should be copied automatically into an Excel sheet(path will be specified by me). Can I do this? If yes, then how?
P.S. We use SQLyog(Open Source) to run SQL queries and Microsoft Excel 2010 to paste and show data.
The is an “SQL Scheduler and Reporting Tool” (in the ‘powertools’ menu), but it will deliver query results as HTML-formatted mail. With the same tool you may schedule a SELECT INTO OUTFILE -query generating a CSV file. But note that SELECT INTO OUTFILE in MySQL has no LOCAL option so the file will be saved on the server machine. Refer MySQL documentaton http://dev.mysql.com/doc/refman/5.5/en/select-into.html.