Insert from select [message #63482] |
Fri, 08 October 2004 10:29 |
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 |
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 |
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
|
|
|