I have a simple Table of data (nickname, score) for a simple android game.
Initially I didn’t put an unique ID for each nickname and now I have multiple entry from the same nickname.
What I want to do now, is consolidate the data by deleting the “extra” entry from the same nickname and maintain their respective high score.
I was trying to make a query to do that but unsuccessfully.
What do you suggest to achieve the result I need?
Try the following (I don’t have an SQLite installation at the moment to test the precise syntax for the correlated subquery):
or (this is correct, thanks to testing by danishgoel in the comments, below)
Should be perfectly performant for a one-time use over a few thousand nicknames.
This will leave you with duplicates if you have two identical scores for a given nickname, is that possible?