duffyciaran
Programmer
Hi - I'm trying to construct a select statement from the following tables(see example)
_________________________________
|Customer | Product | Shop |
|----------|----------|---------|
| | | |
|Customer1 | Milk | Dairy |
| | | |
|Customer2 | Cream | Dairy |
| | | |
|Customer3 | Milk | Dairy |
| | | |
|Customer1 | Trainers | Sports |
| | | |
|Customer2 | Football | Sports |
_________________________________
REQUIRED RESULT SET: Milk, Cream.
Basically I want to select all of the Products (no duplicates) where EVERY customer(1, 2 & 3) have bought a from a common shop type: i.e 'Trainers' and 'Football' should not be selected as Customer3 has not bought any goods from a sports store.
This looks like it should be easy but my SQL isn't the best ;-)
I'd really appreciate any help you could give!!
Cheers!
_________________________________
|Customer | Product | Shop |
|----------|----------|---------|
| | | |
|Customer1 | Milk | Dairy |
| | | |
|Customer2 | Cream | Dairy |
| | | |
|Customer3 | Milk | Dairy |
| | | |
|Customer1 | Trainers | Sports |
| | | |
|Customer2 | Football | Sports |
_________________________________
REQUIRED RESULT SET: Milk, Cream.
Basically I want to select all of the Products (no duplicates) where EVERY customer(1, 2 & 3) have bought a from a common shop type: i.e 'Trainers' and 'Football' should not be selected as Customer3 has not bought any goods from a sports store.
This looks like it should be easy but my SQL isn't the best ;-)
I'd really appreciate any help you could give!!
Cheers!