I have this problem where I need to remove duplicates from my data base, but the rows aren't identical.
For example, lets say this is my scheme:
(id,name,revirew,uid)
After uploading the data to the database, I have the following rows:
123,Dan,"very good",1000
123,Dan,"very good",2000
I want to keep only the first row, because it's the same review but was recorded with different uid, how can I achieve that? (meaning, it's not exactly a duplicate, but in my database it counts as one).
note: my original problem is that I downloaded a reviews dateset that was crawled. The problem is that there are identical reviews but with different ids generated, so I need to remove them. for simplicity purposes I gave this simple example.
EDIT: I want to keep the row with lower uid.
I've searched and only found ways for removing duplicate rows, but in this case they are not really identical thus not considered duplicates and won't be removed.
[SOLVED]:
SELECT id,name,revirew, MIN(uid) FROM ... GROUP BY id,name,revirew;
solved the problem, solution from the comments, by @Atom