Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Oracle Server > Multiple Table ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 12 Topic 16495 of 16958
Post > Topic >>

Multiple Table NOT IN

by Mtek <mtek@[EMAIL PROTECTED] > May 1, 2008 at 11:05 AM

Hi,

This is the basic query:

  SELECT DISTINCT(ol.order_item_id) order_item_id, ca.customer_id
  FROM new_customer.customer c, customer_account ca,
engine.item_subscription i,
  engine.subproduct s, engine.subscription sc, engine.customer_order
co, engine.order_line ol,
  engine.product p
  WHERE c.customer_id = ca.customer_id
    AND ca.customer_id = co.customer_id
    AND co.order_id = ol.order_id
    AND ol.product_id = p.product_id
    AND p.product_id = 23196
    AND ol.status = 'Active'
    AND p.product_id = sc.product_id
    AND ol.order_item_id = i.order_item_id
    AND sc.subproduct_id = i.subproduct_id;

What I am trying to do is find customers who are MISSING access to
their re****ts.

The engine.item_subscription table has 2 columns:  subproduct_id &
order_item_id.  If a record exists with the proper values for the
customer, he has access, else he does not.

So I'm trying to find records where the customer has an ACTIVE order
but is missing records in the item_subscription table......

We are on Oracle 10g.  Hope this is enough info for some help......

Thanks,

John
 




 12 Posts in Topic:
Multiple Table NOT IN
Mtek <mtek@[EMAIL PROT  2008-05-01 11:05:57 
Re: Multiple Table NOT IN
Ed Prochak <edprochak@  2008-05-02 05:43:28 
Re: Multiple Table NOT IN
Tom <tzeblisky@[EMAIL   2008-05-02 06:13:16 
Re: Multiple Table NOT IN
Mtek <mtek@[EMAIL PROT  2008-05-02 08:24:30 
Re: Multiple Table NOT IN
Tom <tzeblisky@[EMAIL   2008-05-02 08:47:55 
Re: Multiple Table NOT IN
Mtek <mtek@[EMAIL PROT  2008-05-02 08:51:21 
Re: Multiple Table NOT IN
patrick <pgovern@[EMAI  2008-05-02 08:57:03 
Re: Multiple Table NOT IN
Mtek <mtek@[EMAIL PROT  2008-05-02 09:46:16 
Re: Multiple Table NOT IN
Mtek <mtek@[EMAIL PROT  2008-05-02 09:51:55 
Re: Multiple Table NOT IN
Mtek <mtek@[EMAIL PROT  2008-05-02 10:09:28 
Re: Multiple Table NOT IN
Mtek <mtek@[EMAIL PROT  2008-05-02 10:16:49 
Re: Multiple Table NOT IN
Mtek <mtek@[EMAIL PROT  2008-05-02 10:50:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 2:13:04 CDT 2008.