Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

NOT IN CLAUSE

user10636796Feb 10 2012 — edited Feb 16 2012
Hi, Everyone,

i have this sql query which is working fine but it is very slow.

select distinct a.customer_no,e.sku_id,e.sku_description, 201152 as weekid
from cust_base a,customer_seg b,cust_sku_purchase c,
associated_cat d,sku_prom e, CAT_SHOP_SCORE g
where
flag = 0
and (a.customer_no not in (select customer_no from recommendation) or e.sku_id not in (select sku_id from recommendation))
and (a.customer_no not in (select customer_no from cust_sku_purchase) or e.sku_id not in (select sku_id from cust_sku_purchase))
and a.customer_no = b.customer_no
and a.customer_no = g.customer_no
and b.segment_id = d.segment_id
and c.category = d.cat_2
and d.cat_1 = e.category

is there any alternative for NOT in clause which would run much faster???

my oracle database version is 11.1.0.6.

Could anyone please help???

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2012
Added on Feb 10 2012
23 comments
724 views