C
cheap
Gday all!
Newbiee here!
I have a question to all the gurus here about an sql query I'm tryin
to make.
Anyway here goes:
I have 4 tables.
Table 1: Customer
- Customer_ID
- Name
Table 2: Sales
- Order_ID
- Customer_ID
- Order_Date
Table 3: Order
- Order_ID
- Product_ID
- Quantity
Table 4: Product
- Product_ID
- Name
I think the way the tables are linked is obvious so I don't need t
explain.
I want to make a report which runs a query to list all the product
that each customer have not ordered before.
e.g.
There are 3 customer Abe, Ben, Charlie.
There are 3 products Apple, Ball, Car.
Abe ordered Apple and Car before.
Ben ordered Apple.
Charlie did not order anything.
So I want the results of my report to be.
Abe: Ball.
Ben: Ball, Car.
Charlie: Apple, Ball, Car.
--------------------
Was I clear enough?
So any of you have any ideas?
Currently what I did was list out all the products that they ordere
previously and manually check the products which they have not ordere
by refering to that lists.
Helps appreciated.
Thanks in advance for helping out this newbiee
Newbiee here!
I have a question to all the gurus here about an sql query I'm tryin
to make.
Anyway here goes:
I have 4 tables.
Table 1: Customer
- Customer_ID
- Name
Table 2: Sales
- Order_ID
- Customer_ID
- Order_Date
Table 3: Order
- Order_ID
- Product_ID
- Quantity
Table 4: Product
- Product_ID
- Name
I think the way the tables are linked is obvious so I don't need t
explain.
I want to make a report which runs a query to list all the product
that each customer have not ordered before.
e.g.
There are 3 customer Abe, Ben, Charlie.
There are 3 products Apple, Ball, Car.
Abe ordered Apple and Car before.
Ben ordered Apple.
Charlie did not order anything.
So I want the results of my report to be.
Abe: Ball.
Ben: Ball, Car.
Charlie: Apple, Ball, Car.
--------------------
Was I clear enough?
So any of you have any ideas?
Currently what I did was list out all the products that they ordere
previously and manually check the products which they have not ordere
by refering to that lists.
Helps appreciated.
Thanks in advance for helping out this newbiee