Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

comparing 2 tables 1

Status
Not open for further replies.

maggielady

Technical User
Jan 3, 2003
60
0
0
US
I have 2 tables both with a memberid. Table1 and table2. If there are any records in table2 that are not in table1, i want to create a record for that memberid. How do I compare the two tables to see what memberid's are in table2 that aren't in table1?? Thanks in advance for your help!!
 

Something like this:

Code:
SELECT * FROM Table2 where MemberID NOT IN (SELECT MemberID FROM Table1) INTO TABLE NewTable

Not sure if that's exactly what you want, but it might put you on the right track.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Thanks Mike!! It worked great!! It put me on the right track!!1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top