Home » RDBMS Server » Server Administration » Insert from select
Insert from select [message #63482] Fri, 08 October 2004 10:29 Go to next message
vqd2697
Messages: 36
Registered: October 2004
Member
I have a SQL statement to insert data into new table from old table with some where clause in Oracle NT version 9.2.0.4. It take forever to finish this? Is there any better ways to do this.

insert into newtable
select * from oldtable (15 million rows)
where set_id = '104'
and from_dt between to_date('20020701','yyyymmdd') and to_date('20020831','yyyymmdd')
and allowed_amt >= 0 ;

Thanks,

Vu
Re: Insert from select [message #63520 is a reply to message #63482] Tue, 12 October 2004 16:09 Go to previous messageGo to next message
cw
Messages: 30
Registered: September 2002
Member
If it is so many rows, you could just write a select statement for the rows you want to add, put it into a script file and then read in the data using SQL Loader.
Re: Insert from select [message #63558 is a reply to message #63482] Fri, 15 October 2004 06:21 Go to previous message
Balaji
Messages: 102
Registered: October 2000
Senior Member
hi
just try creating a view with the said conditions instead of the new table .i think this will work faster .

with best wishes .

balaji
Previous Topic: Alter Tablespace
Next Topic: oracle 10g web console wouldn't start
Goto Forum:
  


Current Time: Fri Sep 27 06:21:16 CDT 2024