|
|
Subject:
MySQL delete redundant fields
Category: Computers > Programming Asked by: lightray-ga List Price: $20.00 |
Posted:
17 Oct 2006 09:18 PDT
Expires: 24 Oct 2006 12:35 PDT Question ID: 774362 |
I want the source code to a Java class that will delete redundant records in a MySQL table. The table has five fields and due to an error in code that populated the table, I now have several redundant records spread throughout it. I want to run a simple program that will delete these rendundant records and leave only one unique record. there is shareware that does this for about $20, but it doesn't work well, and I'd like the simple code that does this anyway. |
|
There is no answer at this time. |
|
Subject:
Re: MySQL delete redundant fields
From: frankcorrao-ga on 17 Oct 2006 09:49 PDT |
Fortunately because mysql doesnt't really have much by way of referential action that I know of, it is pretty easy to do. Let's call the table you are cleaning up A. Create a table with the same schema B. Then run the following sql in this order: insert into B select distinct * from A; ----- Delete from A; ---- insert into A select * from B; ------ drop table B; |
Subject:
Re: MySQL delete redundant fields
From: lightray-ga on 17 Oct 2006 15:11 PDT |
good answer! it worked |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |