Unique Email Address in Mysql

I have a big mail database but there are some dublicate email addresses. I need unique email address lists and i follow this way;

Firstly i create temporary table for unique email address

CREATE  TABLE  mail_temp (  `email` varchar( 255  )  NOT  NULL default  ''

) ENGINE  =  MyISAM;

After i add unique email address to that temp table

INSERT INTO mail_temp SELECT DISTINCT(email) FROM mail_table

I dropped my real email table

DROP TABLE mail_table;

After all, i create new mail table and moved the temporary mail table to in.

CREATE TABLE mail_table( `email` varchar( 255 ) NOT NULL default ''
) ENGINE  = MyISAM;

INSERT INTO mail_table SELECT  DISTINCT(email) FROM mail_temp;

DROP TABLE mail_temp;
Share and Enjoy:
  • StumbleUpon
  • Digg
  • TwitThis
  • FriendFeed
  • del.icio.us
  • MySpace
  • Technorati
  • Facebook
  • Google Bookmarks
  • Live

Enjoy this article?

Consider subscribing to our RSS feed!

Share us Facebook, FriendFeed, Digg

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

No Comments

No comments yet.

Sorry, the comment form is closed at this time.

Oyun