comparing two tables

teiben

Registered User.
Local time
Today, 19:54
Joined
Jun 20, 2002
Messages
462
I have member data in table a from two months ago and member data in another table from one month ago. I need to compare the two so i know whom the new ones are, what is the best approach? there are other things i have to constrain on, but that isn't the issue
 
Hopefully you have a unique ID assigned to each unique member. If so, then all you do is create a LEFT JOIN the tables on that ID and see which ones aren't in the old table. Here's some SQL for that:

Code:
SELECT CurrentTable.ID
FROM CurrentTable LEFT JOIN PastTable ON CurrentTable.ID = PastTable.ID
WHERE (((PastTable.ID) Is Null));

Replace 'CurrentTable' with the name of the current month's table, 'PastTable' with last month's table, and ID with the id field that connects them.

If you don't have a unique ID field, then you need to start thinking about what fields define a unique member.
 

Users who are viewing this thread

Back
Top Bottom