BostonMA
asked on
How to subtract the results of one table from another in sql?
I have two tables:
Customers_New
Customers_Old
Each table has a customer id. How do I show New customers who are not also old customers? That is I want to take the Customers_New table and subtract out the Customers_Old. I tried a few different types of joins but none of them seemed to be doing anything that I expected.
I'm using SQl server 2000.
Customers_New
Customers_Old
Each table has a customer id. How do I show New customers who are not also old customers? That is I want to take the Customers_New table and subtract out the Customers_Old. I tried a few different types of joins but none of them seemed to be doing anything that I expected.
I'm using SQl server 2000.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys.
ASKER
select * from customers_new
inner join customers_old on customers_new.customerid = customer_old.customerid