Initial - added better mleaderboard query

This commit is contained in:
2017-03-10 16:59:58 -08:00
commit 34efe6ac4a
6 changed files with 143 additions and 0 deletions

View File

@ -0,0 +1,5 @@
select trank, tvalue, ifnull(alias, "Unregistered Player")
from Cts_times, Cts_ranks
left join Id2alias
on idvalue = cryptokey
where trank = idrank and Cts_times.mapid = Cts_ranks.mapid and Cts_times.mapid = ?

8
queries/mleaderboard.sql Normal file
View File

@ -0,0 +1,8 @@
select trank, idvalue, tvalue
from Cts_times, Cts_ranks
where trank = idrank and Cts_times.mapid = Cts_ranks.mapid and Cts_times.mapid = ?
order by trank
-- get full leaderboard of the map
-- aliases are not included because
-- not ever player has a registered alias.

7
queries/mplayers.sql Normal file
View File

@ -0,0 +1,7 @@
select idrank, idvalue, alias
from Cts_ranks, Id2alias
where idvalue = cryptokey and mapid = ?
order by idrank
-- get registered/aliased players who have played on
-- the specified map.

8
queries/mranks.sql Normal file
View File

@ -0,0 +1,8 @@
select Cts_ranks.mapid, max(trank), min(tvalue), alias
from Cts_ranks, Cts_times, Id2alias
where Cts_ranks.mapid = Cts_times.mapid
and tvalue != 0
and cryptokey = idvalue
and idrank = 1
group by Cts_ranks.mapid
order by max(trank);

4
queries/rplayers.sql Normal file
View File

@ -0,0 +1,4 @@
select alias, mapid, idrank
from Cts_ranks, Id2alias
where idvalue = cryptokey and cryptokey = ?
order by idrank