title: how to use temporary table multiple times in mysql
body: <p>I have create temporary table in procedure like as below.</p>
  
  <pre><code>create temporary table tmp_table
  (
  id int,
  idate date,
  iname varchar(100)
  )
  
  insert into tmp_table
  select dept_no, dept_create_date,dept_name from dept_record_2016
  union all 
  select dept_no, dept_create_date,dept_name from dept_record_2017;
  
  
  select * from tmp_table;
  
  insert into tmp_table
  select emp_no , date_of_join , emp_full_name from emp_info;
  </code></pre>
  
  <p>And I getting following error ERROR 1137: Can't reopen table: 'tmp_table'.</p>
  
  <p>So how to use same temporary table in procedure multiple times using single temporary table?</p>
  
  <p>Have an alternative solution?</p>