SQL запросы

Мои маст хэв запросы, чтоб не забыть

SELECT `topic_id`,`peer_id` FROM `bb_bt_tracker` WHERE 1 GROUP BY `user_id` ORDER BY `peer_id` LIMIT 10000




SELECT * FROM phpbb_users
WHERE `user_id_motolodka`
IN (
SELECT  *
FROM phpbb_users
GROUP BY  `user_email`
HAVING COUNT(  `user_email` ) > 1
LIMIT 0 , 30
)
ORDER BY  `user_id_motolodka` LIMIT 0 , 30


DELETE FROM `phpbb_users` WHERE `user_id`>48;
DELETE FROM `phpbb_user_group` WHERE `user_id`>48;
DELETE FROM `phpbb_user_notifications` WHERE `user_id`>48;
DELETE FROM `phpbb_profile_fields_data` WHERE `user_id`>2;

ALTER TABLE phpbb_users AUTO_INCREMENT=0;
ALTER TABLE phpbb_profile_fields_data AUTO_INCREMENT=0;
UPDATE `phpbb_config` SET `config_value`=2 WHERE `config_name`='num_users';
UPDATE bb_bookmarks SET topic_id= 12512 WHERE topic_id= 100334;
UPDATE bb_bt_dlstatus_main SET topic_id= 12512 WHERE topic_id= 100334;
UPDATE bb_bt_dlstatus_mrg SET topic_id= 12512 WHERE topic_id= 100334;
UPDATE bb_bt_dlstatus_new SET topic_id= 12512 WHERE topic_id= 100334;
UPDATE bb_bt_last_torstat SET topic_id= 12512 WHERE topic_id= 100334;
UPDATE bb_bt_torrents SET topic_id= 12512 WHERE topic_id= 100334;
UPDATE bb_bt_torstat SET topic_id= 12512 WHERE topic_id= 100334;
UPDATE bb_bt_tracker SET topic_id= 12512 WHERE topic_id= 100334;
UPDATE bb_bt_tracker_snap SET topic_id= 12512 WHERE topic_id= 100334;
UPDATE bb_posts SET topic_id= 12512 WHERE topic_id= 100334;
UPDATE bb_topics SET topic_id= 12512 WHERE topic_id= 100334;
UPDATE bb_topics_watch SET topic_id= 12512 WHERE topic_id= 100334;