Delete Duplicates

A

Amit Kulkarni

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

Regards,

Amit Kulkarni
 
C

Craig Demyanovich

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
 
L

Lloyd Linklater

Amit said:
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
 
A

Amit Kulkarni

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top