]> git.xonotic.org Git - xonotic/xonstatdb.git/blob - queries/show_elo_rot.sql
eccbe6d471b31fb3d6bdf3b2336f16422b004ea1
[xonotic/xonstatdb.git] / queries / show_elo_rot.sql
1 select 
2   player_id,
3   game_type_cd,
4   elo current_elo, 
5   update_dt last_update_dt, 
6   (current_date - (update_dt::date)) number_of_days, 
7   (current_date - (update_dt::date))-30 number_of_days_past_30, 
8   (current_date - (update_dt::date)-31)/7 penalty,
9   greatest(100, elo - ((current_date - (update_dt::date)-31)/7)) new_elo
10 from player_elos
11 where 
12   update_dt < (current_timestamp at time zone 'UTC' - interval '30 days')
13   and elo != 100;