I have a mysql database with some huge tables, i have a task that I must run three queries one after another and the last one exports to the outfile.csv.
i.e. Query 1. Select values from some tables with certain parameter. then write into a new table. aprox 4.5 hours
Query 2. After the first one is done, then use the new table join with another to get results to new table. Then write to outfile.csv. aprox 2 hours
How do I manage to automatically call these queries one after another even though one can take 4 hours to finish
I am open to any solution, Scripts, or database functions. I am running on ubuntu server so, no graphical solutions.
Thanks for your help.