Delete Duplicates

Hello Sir/Madam,
I want to know how can i delete duplicates entries from
database using rake task.

Regards,

Amit K.

Amit K. wrote:

            I want to know how can i delete duplicates entries from

database using rake task.

I am not sure if you are asking to learn about rake tasks or database
cleanup. Assuming that the result is what matters, I suggest that you
apply a primary index to the fields you are checking. That will remove
duplicates automatically.

hth

I don’t know of any built-in task that already does that. Thus, you’ll
have to:

  • Figure out how to detect duplicates in your data.
  • Write some code to detect and delete the duplicates.
  • Write a rake task to call the code that you wrote in the previous
    step.
  • Run the rake task.

Good luck,
Craig

Thankyou for your advice…if possible can u suggest me how to detect n
delete duplicates…