Home » RDBMS Server » Server Administration » system hangs while running this query
system hangs while running this query [message #55456] Fri, 24 January 2003 14:33 Go to next message
jinga
Messages: 116
Registered: January 2003
Senior Member
Insert into table2
select * from table1
where (col1,col2,col3)
not in (select col1,col2,col3
from table2);
I need to run the above query.But the problem is Table 1 has 100000 rows and table2 has one million rows.The system hangs whenever I run this query. Any ideas???
Re: system hangs while running this query [message #55457 is a reply to message #55456] Fri, 24 January 2003 14:47 Go to previous message
N.A. Jam
Messages: 23
Registered: January 2003
Junior Member
Try rewriting it using a not exists as in:

SELECT * FROM TABL1 A
WHERE NOT EXISTS (SELECT 'X' FROM TABLE2 B
WHERE B.COL1 = A.COL1
AND B.COL2 = A.COL2
AND B.COL3 = A.COL3)
Previous Topic: Oracle Processes
Next Topic: Datafile resizing
Goto Forum:
  


Current Time: Fri Sep 20 04:57:53 CDT 2024