我在過程中創建臨時表,如下所示。如何在mysql中多次使用臨時表
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;
我得到以下錯誤錯誤1137:無法重新打開表:'tmp_table'。
那麼如何在多次使用單個臨時表的過程中使用相同的臨時表?
有其他解決方案嗎?
當你得到的錯誤。請編輯你的問題與錯誤消息。好問題! –
https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem – e4c5
@PhilippSander我已經在我的問題中提到,但錯誤1137:無法重新打開表:'tmp_table' – Smith