Microsoft
Software
Hardware
Network
Question : SQL Query Help
I have a table that looks similar to this.
Customer_ID Product_id
100 5000
100 5001
100 5002
101 5001
101 5002
I need to figure out a query that can show me every customer that has purchased products 5001 and 5002 but NOT 5000
In the example above, the query would bring back customer 101 since customer 100 did order product 5000.
Thanks.
Answer : SQL Query Help
Probably many ways to do this, but one is:
select distinct CustomerID
from CustProd
where ProductID in (5001, 5002)
and not CustomerID in (
select CustomerID
from CustProd
where ProductID in (5000))
Random Solutions
Cisco Unity Express to Trigger MWI on overlay DN
Exhange 2003 mailbox permissions
alter does it drop
Intel Sata RAID controller on RHEL 4 problem
Meetings reschuled are still showing old meeting date and time
How to stablish a proper setup in MS Outlook 2003 encrypting mails
How to read a CSV using Windows Command Line
Asp.Net MVC PartialView doesn't Refresh after Ajax postback
Inserting another drawing
Ran a disk clean-up and a de-frag