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
Should 3rd party drivers start in safe mode?
In Outlook, Advanced Find - Search for Attachment name
How to configure Active Sync in Exchange 2003 and iPhone 3GS
ipconfig shows lots of "tunnel adapters", what are they?
How do I hide site tabs from certain users?
How do I decide on the hardware components required for assembling a CPU for Development purpose (Microsoft & Adobe Technologies).
Adding Exchange 2010 server to an existing Exchange 2000
Redistributing RIP into OSPF non-contiguous subnets.
prevent user from accessing specific form
802.1q trunk