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
Exchange 2010 Tarpit issue
PHP - session variables lost between subfolders
Creating Visual Studio 2008 Development Environment for Sharepoint 2007 Sequential Workflows
i need a regexp which eliminate all what's not a number or a ";"
Microsoft WORD doesnt open full screen
How do I count the number of characters in the attached php function and send alert message?
How to disable form fields in Coldfusion flash form by clicking a checkbox?
Login to SSRS as andmistrator rather than anonymous user.
Controlling main application threads from within an instance of a class
MS SQL Server only using one core on a 4 core box