copyproject is a problem in drop tmp table - drop table if exists tmp - and create temporary table tmp select *