diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2008-12-11 14:05:12 +0100 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2008-12-11 14:05:12 +0100 |
commit | ae5ee7a18295b0f50ce2a363d01eed8a45fd9bb5 (patch) | |
tree | d3cc4ca2280f49131d85fa5a1df5ecfe35f659ba | |
parent | e3f156e8625f661b09f950eaad3d4cfcc3b1e5d9 (diff) |
[DB] Displays which entries will be deleted with database.cleanup
-rw-r--r-- | database.cleanup | 1 |
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 ; |