A more complex query with separated steps delimited by ; does not seem to execute
This is an example query I used and it reported error 5000 at line 8, which is where the second select statement starts.
CREATE TEMPORARY TABLE if not exists temp_projects AS
SELECT projects.id, clients.name, projects.project_name, projects.estimated_hours, projects.actual_hours
FROM clients
JOIN projects ON clients.id=projects.client_id
WHERE projects.active='TRUE'
ORDER BY clients.name ASC;
SELECT temp_projects.`name`, temp_projects.project_name, tasks.task_name, tasks.estimated_hours, tasks.total_hours, tasks.used, tasks.recent
FROM tasks
JOIN temp_projects ON temp_projects.id=tasks.project_id
ORDER BY temp_projects.name ASC, temp_projects.project_name ASC, tasks.task_name ASC;
DROP TABLE if EXISTS temp_projects;
If we split these three statements into three separate queries then the issue is solved.
Edited by Ioan Polenciuc