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 > Re: Multiple Ta...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 12 Topic 16495 of 17140
Post > Topic >>

Re: Multiple Table NOT IN

by Ed Prochak <edprochak@[EMAIL PROTECTED] > May 2, 2008 at 05:43 AM

On May 1, 2:05 pm, Mtek <m...@[EMAIL PROTECTED]
> wrote:
> 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

Sorry, but it's not enough information for me.

you say there is a relation between customers and subscriptions. But
the only way there I can see from the WHERE clause is thru Orders.
And there seems to be a circular relation among order line
subscription and item subscription.

I'm lost. perhaps you could post some of the relevant table
information (PK/FK)?
ed
 




 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
tan12V112 Sun Sep 7 18:14:28 CDT 2008.