January 2, 2007 at 3:20 pm
Hi all,
I have two tables. The first one 'AccountActivity' and the other 'PaymentInfo'.
When a payment is made, the user marks the account with a status code which is saved in 'Account Activity' and they also save the payment information in 'PaymentInfo'; the two tables are related only by the 'AccountId'
What I would like to do is check the 'AccountActivity' table for status codes of say, 405 and 405 and see if they 'AccountId' exists in the 'PaymentInfo' table.
INNER JOIN will not suffice because I don't want to see matching records, I want to see un-match records.
This is simple but yet, I can't seem to achieve the correct results.
Thanks,
Tim
January 2, 2007 at 3:38 pm
January 2, 2007 at 3:50 pm
Your description is a bit confusing Tim. Can you post the DDL for both tables, sample data, and an example of your desired results.
January 2, 2007 at 4:12 pm
I agree, more information would help us help you. But, I'm willing to take a stab at it. In the description you said status codes 405 and 405, but you might have meant 405 and 406 so the query will assume that's what you meant.
Aunt Kathi Data Platform MVP
Author of Expert T-SQL Window Functions
Simple-Talk Editor
January 2, 2007 at 5:40 pm
I apologize for the vague and incomplete information. The information, provided so far, may be exactly what I'm looking for. I'll try the suggested queries when I get to the office tomorrow.
Thanks!
January 3, 2007 at 4:23 pm
The above suggestions helped out a great deal. I am able to get the results I need.
Thanks!
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply