From 44e46e5c71af611784143a2ebf1a36042c3302ac Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 11 Dec 2008 14:12:11 +0100 Subject: [DB] remove badges variants : script corrections + renaming --- database.cleanup | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 database.cleanup (limited to 'database.cleanup') diff --git a/database.cleanup b/database.cleanup deleted file mode 100644 index 1d3d918..0000000 --- a/database.cleanup +++ /dev/null @@ -1,17 +0,0 @@ - -USE lastfm - - -/** - * Deletes all entries in badges - * for each unique username + type - * where more than one style or color exists - */ - -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 ; - - -- cgit v1.2.3