Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Curious SQL question

Curious SQL question

From: Guto <gutomore_at_gmail.com>
Date: 3 Jan 2007 04:16:42 -0800
Message-ID: <1167826602.405469.312020@48g2000cwx.googlegroups.com>


Hi There!
If I have two tables:

Products
-Product_ID
-Product_Name

and

Orders
-Customer_ID
-Product_ID

How can I find out what products, each customer DIDN'T bought?

I tried lots of SQL sentences, but I can onlye get it solved, through a Stored Procedure.

The obvius does not work:

Select Customer_ID, Product_ID from Orders where Product_ID not in ( select Product_id from Products )

Any Tips?

Regards
Carlos Augusto Received on Wed Jan 03 2007 - 06:16:42 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US