Forum Moderators: coopster

Message Too Old, No Replies

Copying content of a mysql table

         

turbohost

4:55 pm on Dec 2, 2003 (gmt 0)

10+ Year Member



Hi,

I want to copy the content of a table with lots of duplicate e-mailaddresses into another, new table (which should have only unique e-mail addresses). How can I do this most efficient? The old table and the new table have different columns. There are also some other columns (like Ip address) I want to copy to the new table).

Turbohost

jatar_k

5:03 pm on Dec 2, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could script it.

Select row from old table
Check for dup data, add new cols
Insert into new table

shouldn't be too tough, dont remove anything until you have checked, rechecked and then made sure that all went well.

turbohost

7:24 pm on Dec 2, 2003 (gmt 0)

10+ Year Member



How do I check for duplicate entries?

jatar_k

8:07 pm on Dec 2, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could SELECT DISTINCT [mysql.com] which would weed out duplicates.

search the linked page for distinct