mjdth Posted September 10, 2007 Share Posted September 10, 2007 Hi, I have a table with fields for ID, name, and email. There are some duplicates so I want to go through and remove duplicates by deleting any items that have the same email (leaving one of the items, of course). What's the best way of accomplishing this? Can this be done with just SQL? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/68676-deleting-duplicates-from-a-table/ Share on other sites More sharing options...
Illusion Posted September 10, 2007 Share Posted September 10, 2007 add unique to your email column http://dev.mysql.com/doc/refman/5.0/en/alter-table.html Quote Link to comment https://forums.phpfreaks.com/topic/68676-deleting-duplicates-from-a-table/#findComment-345228 Share on other sites More sharing options...
fenway Posted September 11, 2007 Share Posted September 11, 2007 add unique to your email column http://dev.mysql.com/doc/refman/5.0/en/alter-table.html Assuming that they're all the same, mysql will pick a random one. Quote Link to comment https://forums.phpfreaks.com/topic/68676-deleting-duplicates-from-a-table/#findComment-346098 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.