CREATE GLOBAL TEMPORARY TABLE tmp_test as
select * from tb_backorder where 1 = 0
insert into tmp_test select * from tb_backorder//显示有数据插入成功
select * from tmp_test//但为什么查询不到数据???
------解决方案--------------------
- SQL code
select * from tb_backorder;--应是此处没记录--例:SQL> drop table tmp_test;已刪除表格.SQL> create global temporary table tmp_test as 2 select * from emp where 1=2;已建立表格.SQL> insert into tmp_test select * from emp;已建立 14 個資料列.SQL> select count(1) from tmp_test; COUNT(1) ---------- 14