widget Posted November 24, 2009 Share Posted November 24, 2009 I have 2 tables One called members2 and one called members_profiles2 Both contain the field name "username" the mp2 table has over 1000 extra records than the m2 table. How do I create a comparison script that will... Check the usernames in mp2 and compare them with m2 and display the usernames left over? Its the left overs that I need to delete. Thanks for any help. php and MySQL Quote Link to comment Share on other sites More sharing options...
widget Posted November 24, 2009 Author Share Posted November 24, 2009 Any ideas please? Im desperate to get it done tonight Quote Link to comment Share on other sites More sharing options...
widget Posted November 25, 2009 Author Share Posted November 25, 2009 no takers? Quote Link to comment Share on other sites More sharing options...
cags Posted November 25, 2009 Share Posted November 25, 2009 SELECT * FROM members_profiles2 WHERE username NOT IN ( SELECT username FROM members2 ) EDIT: Just realised you want to delete. Use this to check you get the right values then use DELETE. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.