I have a sqlite3 database in a rails app. It contains amongst others these columns: name, telephone, latitude, longitude.
These are all strings. These correspond to businesses. I noticed that many entries in the database are duplicates.
How do I remove these from my rails database? Do I need to write SQL or is there a function in rails that takes in column names and removes entries that have similar values in those columns.
If SQL is the best way, how should my query look like.
I tried the following query but my database browser crashed:
SELECT *
FROM listings L1, listings L2
WHERE L1.name = L2.name
AND L1.telephone = L2.telephone
EDIT: I found this post helpful. But still looking for a solution thats airtight.