I am trying to assist a nonprofit that has access to Heidi for the backend but nothing else. I need to run the following queries against about 1000 instances of the database and create a master list of the results. The two queries below will produce the desired results but it populates to two tabs in Heidi and won't combine into 1 query. They will need to run this report once a week so producing 1000 tabs and trying to manually export and combine those files is not an option. From each databse instance, I am attempting to pull the last time the ticket was used for each customer. This isn't my database and I don't have the ability to edit just access the results through Heidi on a restricted machine. UNION doesn't seem to work and I don't have rights to output the information to a file on the server. Is there any way I can have these results displayed in one query tab in Heidi so I can export the results list from Heidi in one file? Every db instance is identical and I need the same fields from each query.
USE db1-customer1
; SELECT ticket.location_id, ticket.updated_on, location.legal_name FROM ticket, location ORDER BY ticket.updated_on DESC LIMIT 1;
USE db2-customer1
; SELECT ticket.location_id, ticket.updated_on, location.legal_name FROM ticket, location ORDER BY ticket.updated_on DESC LIMIT 1;