MySQL Forums
Forum List  »  Newbie

Re: Remove duplicated entries (between 2 columns)
Posted by: timb
Date: June 01, 2005 04:04PM

You can use UNION syntax to return only distinct e-mail addresses. See http://dev.mysql.com/doc/mysql/en/union.html for more information. However this won't work if you need other info such as customer name or a primary key that could be used to run an update query.

I think you would need another query to select duplicates and then update the fields, but not sure you should do that. What happens if Mary and John have the same e-mail so you delete John's e-mail address but then Mary changes her e-mail address? This leaves you with no way to contact John.

I recommend that you use a query to select distinct e-mail addresses and leave the data as it is.

Options: ReplyQuote


Subject
Written By
Posted
Re: Remove duplicated entries (between 2 columns)
June 01, 2005 04:04PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.