summaryrefslogtreecommitdiff
path: root/database.cleanup
diff options
context:
space:
mode:
Diffstat (limited to 'database.cleanup')
-rw-r--r--database.cleanup1
1 files changed, 1 insertions, 0 deletions
diff --git a/database.cleanup b/database.cleanup
index a3ebe2b..1d3d918 100644
--- a/database.cleanup
+++ b/database.cleanup
@@ -10,6 +10,7 @@ USE lastfm
DROP TABLE IF EXISTS tmp ;
CREATE TEMPORARY TABLE tmp (SELECT username, type, COUNT(username) AS count FROM badges GROUP BY username, type ) ;
+SELECT * FROM tmp WHERE count > 1 ;
DELETE badges FROM badges, tmp WHERE badges.username = tmp.username AND tmp.count > 1 ;
DROP TABLE tmp ;