Add select union queries and using the resultset write to a local file and load data infile into mysql