Unique Email Address in Mysql
13
Oct0
Oct0
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;

