Add get_latest_leaderboard

This commit is contained in:
norohind committed 2022-01-31 20:04:23 +03:00
1 parent c5ae70a5f8
commit c129c3d1bf
5 files changed
+164 -45

No files matched your search

+18 -1
View File
@@ -98,7 +98,7 @@ limit 1000;
"""
select_leaderboard_by_action_id = """select
name,
name as squadron_name,
tag,
rank,
score,
@@ -110,3 +110,20 @@ from squads_stats_states
where action_id = %(action_id)s
order by score desc;
"""
select_latest_leaderboard = """select
name as squadron_name,
tag,
rank,
score,
to_char(timestamp, 'YYYY-MM-DD HH24:MI:SS') as timestamp,
leaderboard_type,
platform,
squadron_id
from squads_stats_states
where action_id = (
select max(action_id) as action_id
from squads_stats_states
where leaderboard_type = %(LB_type)s and platform = %(platform)s)
order by score desc;
"""