· 10 years ago · Aug 22, 2016, 12:44 PM
1drop table if exists char_MaxIDS;
2create table char_MaxIDS as select PlayerUID, max(CharacterId) as MaxID from character_data group by PlayerUID;
3delete from character_data where CharacterID not in (select MaxID from char_MaxIDS);
4
5delete from character_data where LastLogin < date_sub(current_timestamp,interval 2 day) and Alive = 0;
6delete from character_data where LastLogin < date_sub(current_timestamp,interval 10 day) and Alive = 1;