Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle SQL Condition Question...
On 20 Apr 1998 18:39:36 GMT, gosar_at_EBB.Eng.Sun.COM (Bhavesh Gosar) wrote:
>Hi,
>
>I have 2 tables
>
>Both the tables above contain approx. 60,000 Records
>and have indexes on f1 and f2.
>
>I have an SQL which is the foll..
>
>Insert into tab3 ( select * from tab1 where tab1.f1 not in
> (select distinct tab2.f2 from tab2));
>
>The problem is this SQL takes around 40-45 hours to execute...
>
>Am i missing something here...Or any Workarounds Possible...??
INSERT INTO tab3
(SELECT * FROM tab1 WHERE NOT EXISTS
(SELECT tab2.f2 FROM tab2 WHERE tab2.f2 = tab1.f1) );
>TIA,
>Bg
Regards,
Jurij Modic Republic of Slovenia jurij.modic_at_mf.sigov.mail.si Ministry of Finance ============================================================The above opinions are mine and do not represent any official standpoints of my employer Received on Tue Apr 21 1998 - 00:00:00 CDT
![]() |
![]() |