如果是要构造: SQL> begin 2 for i in 1..4000000 loop 3 insert into t22 values(i); 4 end loop; 5 end; 6 /PL/SQL procedure successfully completed.如果数据库里是已经存在的数据, 那直接create table xxx as select xxx from xxx ;如果是excel那种外部的数据, 用sqloader工具。
是从oracle物理表,从有2千万条记录的表中,取40w条记录插入到一临时表中。
create table xxx as select xxx from xxx where col=''
insert into tempTable select * from tableName where xxxx=xx; commit;
还是文本?excle ?
SQL> begin
2 for i in 1..4000000 loop
3 insert into t22 values(i);
4 end loop;
5 end;
6 /PL/SQL procedure successfully completed.如果数据库里是已经存在的数据,
那直接create table xxx as select xxx from xxx ;如果是excel那种外部的数据,
用sqloader工具。
select * from tableName where xxxx=xx;
commit;
insert into 表名 ... as select...
不错,lz你这里所提的临时表,是指的应用上的临时表,还是oracle里提及的临时表,如果是前者,可以加上append的hint。
应用上的临时表是不是指的一张物理表作为临时表,而oracle里提及的临时表,是否指的是下面这样?
with temp_table_name
as
(select ....)
--直接装载方式
INSERT /*+APPEND*/ INTO t1 SELECT * from t2;
INSERT /*+APPEND*/ INTO t1 SELECT * from t2;这一种方式比较哪里一种会快一点呢,明天去公司试下午
SELECT empno, ename, sal, deptno FROM emp
WHERE deptno = 20;
SELECT /*+ parallel(emp)*/ empno, ename, sal, deptno FROM emp
WHERE deptno = 20;