I have just moved over to a new job and been given the task of trying to sort out historic client databases (MS-Access). I have exported everything to CSV, then into MySQL 5.0.15 no problems at all. However due to the way the original system was developed i have so much duplicated data it is crazy.

Can anyone point me in the right direction for a method to delete records based on a a field value if it also exists in another table.

ie.

Table "ClientJun2005" contains fields "customercode", "name", "address", "telephone", with the field "customercode" being the Unique Primary Key.

Table "ClientAug2005" contains fields "customercode", "name", "address", "telephone", with the field "customercode" being the Unique Primary Key.

What I need is to compare tables "ClientJun2005" and "ClientAug2005" by "customercode" when the this value exists in both databases delete one and leave one alone.

I know that it would be possible to do this with PHP but home that there is a simple MySQL method I can run direct of MySQL.

Hope someone can help me out.

Stephen


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to